aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/kotlin/model/PackageTest.kt
diff options
context:
space:
mode:
authoraleksZubakov <aleks.zubakov@gmail.com>2018-07-12 15:37:18 +0300
committeraleksZubakov <aleks.zubakov@gmail.com>2018-07-12 15:37:18 +0300
commit960ea9ebb01f280c4966e139c1697f083e9d8965 (patch)
tree05bb14e7faf1b74a0abf89f69a73023b4373eefd /core/src/test/kotlin/model/PackageTest.kt
parent65b61e31b761071589e257381bea33557d932412 (diff)
downloaddokka-960ea9ebb01f280c4966e139c1697f083e9d8965.tar.gz
dokka-960ea9ebb01f280c4966e139c1697f083e9d8965.tar.bz2
dokka-960ea9ebb01f280c4966e139c1697f083e9d8965.zip
Test refactoring and split by different platforms
Diffstat (limited to 'core/src/test/kotlin/model/PackageTest.kt')
-rw-r--r--core/src/test/kotlin/model/PackageTest.kt40
1 files changed, 30 insertions, 10 deletions
diff --git a/core/src/test/kotlin/model/PackageTest.kt b/core/src/test/kotlin/model/PackageTest.kt
index 052f0d28..bc8a0e0d 100644
--- a/core/src/test/kotlin/model/PackageTest.kt
+++ b/core/src/test/kotlin/model/PackageTest.kt
@@ -9,7 +9,7 @@ import org.junit.Test
public class PackageTest {
@Test fun rootPackage() {
- verifyModel("testdata/packages/rootPackage.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/packages/rootPackage.kt") { model ->
with(model.members.single()) {
assertEquals(NodeKind.Package, kind)
assertEquals("", name)
@@ -22,7 +22,7 @@ public class PackageTest {
}
@Test fun simpleNamePackage() {
- verifyModel("testdata/packages/simpleNamePackage.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/packages/simpleNamePackage.kt") { model ->
with(model.members.single()) {
assertEquals(NodeKind.Package, kind)
assertEquals("simple", name)
@@ -35,7 +35,7 @@ public class PackageTest {
}
@Test fun dottedNamePackage() {
- verifyModel("testdata/packages/dottedNamePackage.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/packages/dottedNamePackage.kt") { model ->
with(model.members.single()) {
assertEquals(NodeKind.Package, kind)
assertEquals("dot.name", name)
@@ -48,8 +48,14 @@ public class PackageTest {
}
@Test fun multipleFiles() {
- verifyModel(KotlinSourceRoot("testdata/packages/dottedNamePackage.kt"),
- KotlinSourceRoot("testdata/packages/simpleNamePackage.kt")) { model ->
+ verifyModel(
+ ModelConfig(
+ roots = arrayOf(
+ KotlinSourceRoot("testdata/packages/dottedNamePackage.kt"),
+ KotlinSourceRoot("testdata/packages/simpleNamePackage.kt")
+ )
+ )
+ ) { model ->
assertEquals(2, model.members.count())
with(model.members.single { it.name == "simple" }) {
assertEquals(NodeKind.Package, kind)
@@ -70,8 +76,14 @@ public class PackageTest {
}
@Test fun multipleFilesSamePackage() {
- verifyModel(KotlinSourceRoot("testdata/packages/simpleNamePackage.kt"),
- KotlinSourceRoot("testdata/packages/simpleNamePackage2.kt")) { model ->
+ verifyModel(
+ ModelConfig(
+ roots = arrayOf(
+ KotlinSourceRoot("testdata/packages/simpleNamePackage.kt"),
+ KotlinSourceRoot("testdata/packages/simpleNamePackage2.kt")
+ )
+ )
+ ) { model ->
assertEquals(1, model.members.count())
with(model.members.elementAt(0)) {
assertEquals(NodeKind.Package, kind)
@@ -85,7 +97,9 @@ public class PackageTest {
}
@Test fun classAtPackageLevel() {
- verifyModel(KotlinSourceRoot("testdata/packages/classInPackage.kt")) { model ->
+ verifyModel(
+ ModelConfig(roots = arrayOf(KotlinSourceRoot("testdata/packages/classInPackage.kt")))
+ ) { model ->
assertEquals(1, model.members.count())
with(model.members.elementAt(0)) {
assertEquals(NodeKind.Package, kind)
@@ -99,8 +113,14 @@ public class PackageTest {
}
@Test fun suppressAtPackageLevel() {
- verifyModel(KotlinSourceRoot("testdata/packages/classInPackage.kt"),
- perPackageOptions = listOf(PackageOptionsImpl(prefix = "simple.name", suppress = true))) { model ->
+ verifyModel(
+ ModelConfig(
+ roots = arrayOf(KotlinSourceRoot("testdata/packages/classInPackage.kt")),
+ perPackageOptions = listOf(
+ PackageOptionsImpl(prefix = "simple.name", suppress = true)
+ )
+ )
+ ) { model ->
assertEquals(1, model.members.count())
with(model.members.elementAt(0)) {
assertEquals(NodeKind.Package, kind)