aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/model/ClassesTest.kt
diff options
context:
space:
mode:
authorMarcin Aman <maman@virtuslab.com>2020-07-02 13:21:00 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-07-13 14:47:37 +0200
commitb67f44943bc80dedd70c4a9e120b9c6aec78ca72 (patch)
tree349a417b0ed67e1220b4d7c3c82800a7d3a956bd /plugins/base/src/test/kotlin/model/ClassesTest.kt
parentf042de920724f6e2ae4ccbcb21baed6b490290ab (diff)
downloaddokka-b67f44943bc80dedd70c4a9e120b9c6aec78ca72.tar.gz
dokka-b67f44943bc80dedd70c4a9e120b9c6aec78ca72.tar.bz2
dokka-b67f44943bc80dedd70c4a9e120b9c6aec78ca72.zip
Draft for showing only first level of inheritance
Diffstat (limited to 'plugins/base/src/test/kotlin/model/ClassesTest.kt')
-rw-r--r--plugins/base/src/test/kotlin/model/ClassesTest.kt36
1 files changed, 33 insertions, 3 deletions
diff --git a/plugins/base/src/test/kotlin/model/ClassesTest.kt b/plugins/base/src/test/kotlin/model/ClassesTest.kt
index 979ea89b..5dc8812e 100644
--- a/plugins/base/src/test/kotlin/model/ClassesTest.kt
+++ b/plugins/base/src/test/kotlin/model/ClassesTest.kt
@@ -221,7 +221,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class
with((this / "f").cast<DFunction>()) {
modifier.values.forEach { it equals Open }
}
- D.supertypes.flatMap { it.component2() }.firstOrNull() equals C.dri
+ D.supertypes.flatMap { it.component2() }.firstOrNull()?.dri equals C.dri
}
}
}
@@ -258,8 +258,8 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class
modifier.values.forEach { it equals Final }
}
- D.supers.single() equals C.dri
- E.supers.firstOrNull() equals D.dri
+ D.supers.single().dri equals C.dri
+ E.supers.single().dri equals D.dri
}
}
@@ -500,4 +500,34 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class
}
}
}
+
+ @Test fun multipleClassInheritance() {
+ inlineModelTest(
+ """
+ | open class A { }
+ | open class B: A() { }
+ | class Tested : B() { }
+ """.trimIndent()
+ ) {
+ with((this / "classes" / "Tested").cast<DClass>()) {
+ supertypes.entries.single().value.map { it.dri.sureClassNames }.single() equals "B"
+ }
+ }
+ }
+
+ @Test fun multipleClassInheritanceWithInterface(){
+ inlineModelTest(
+ """
+ | open class A { }
+ | open class B: A() { }
+ | interface X { }
+ | interface Y : X { }
+ | class Tested : B(), Y { }
+ """.trimIndent()
+ ){
+ with((this / "classes" / "Tested").cast<DClass>()) {
+ supertypes.entries.single().value.map { it.dri.sureClassNames to it.kind }.sortedBy { it.first } equals listOf("B" to KotlinClassKindTypes.CLASS, "Y" to KotlinClassKindTypes.INTERFACE)
+ }
+ }
+ }
} \ No newline at end of file