aboutsummaryrefslogtreecommitdiff
path: root/plugins/kotlin-as-java/src/test
diff options
context:
space:
mode:
authorMarcin Aman <maman@virtuslab.com>2020-07-13 16:46:36 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-07-14 07:56:39 +0200
commit0104134b4891ccc97c27d4fee9846a9f74d46d0a (patch)
treeb27fa6cb6c9a8d72a877168315964801a643e872 /plugins/kotlin-as-java/src/test
parentcc47adfc40e6e0ce288df55ed6271e96ae232ae7 (diff)
downloaddokka-0104134b4891ccc97c27d4fee9846a9f74d46d0a.tar.gz
dokka-0104134b4891ccc97c27d4fee9846a9f74d46d0a.tar.bz2
dokka-0104134b4891ccc97c27d4fee9846a9f74d46d0a.zip
Kotlin as Java should translate class kinds
Diffstat (limited to 'plugins/kotlin-as-java/src/test')
-rw-r--r--plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt52
1 files changed, 52 insertions, 0 deletions
diff --git a/plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt b/plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt
index ba513bf2..e12ec6cb 100644
--- a/plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt
+++ b/plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt
@@ -237,6 +237,58 @@ class KotlinAsJavaPluginTest : AbstractCoreTest() {
}
}
+ @Test
+ fun `koltin interfaces and classes should be split to extends and implements`(){
+ val configuration = dokkaConfiguration {
+ sourceSets {
+ sourceSet {
+ sourceRoots = listOf("src/")
+ }
+ }
+ }
+ testInline(
+ """
+ |/src/main/kotlin/kotlinAsJavaPlugin/Test.kt
+ |package kotlinAsJavaPlugin
+ |
+ | open class A { }
+ | interface B
+ | class C : A(), B
+ """,
+ configuration,
+ cleanupOutput = true
+ ) {
+ pagesGenerationStage = { root ->
+ val testClass = root.dfs { it.name == "C" } as? ClasslikePageNode
+ assert(testClass != null)
+ testClass!!.content.assertNode {
+ group {
+ header(expectedLevel = 1) {
+ +"C"
+ }
+ platformHinted {
+ group {
+ +"public final class"
+ link {
+ +"C"
+ }
+ +" extends "
+ link {
+ +"A"
+ }
+ +" implements "
+ link {
+ +"B"
+ }
+ }
+ }
+ }
+ skipAllNotMatching()
+ }
+ }
+ }
+ }
+
private fun <T> Collection<T>.assertCount(n: Int, prefix: String = "") =
assert(count() == n) { "${prefix}Expected $n, got ${count()}" }