diff options
author | Marcin Aman <maman@virtuslab.com> | 2020-07-13 16:46:36 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-07-14 07:56:39 +0200 |
commit | 0104134b4891ccc97c27d4fee9846a9f74d46d0a (patch) | |
tree | b27fa6cb6c9a8d72a877168315964801a643e872 /plugins/kotlin-as-java/src/test | |
parent | cc47adfc40e6e0ce288df55ed6271e96ae232ae7 (diff) | |
download | dokka-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.kt | 52 |
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()}" } |