Skip to content

Commit

Permalink
[K2] Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
vmishenev committed Dec 4, 2023
1 parent 417b17b commit fbe0968
Showing 1 changed file with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import org.jetbrains.dokka.Platform
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.links.PointingToDeclaration
import org.jetbrains.dokka.model.DClass
import org.jetbrains.dokka.model.dfs
import org.jetbrains.dokka.model.doc.*
import org.jetbrains.dokka.model.withDescendants
Expand Down Expand Up @@ -111,6 +112,40 @@ class MultiLanguageInheritanceTest : BaseAbstractTest() {
}
}

@Test
fun `java nested classed should not be in inheritor`() {
testInline(
"""
|/src/main/kotlin/sample/ParentInKotlin.kt
|package sample
|class Child: JavaParent()
|
|class KotlinParent {
| class NestedJavaParent
|}
|class ChildB: KotlinParent()
|
|/src/main/kotlin/sample/ChildInJava.java
|package sample;
|public class JavaParent {
| public class InnerJavaParent{}
| public static class NestedJavaParent{}
|}
""".trimIndent(),
configuration
) {
documentablesMergingStage = { module ->
val childBClass = module.packages.flatMap { it.classlikes }
.find { it.name == "ChildB" } as DClass
assertEquals(childBClass.classlikes, emptyList())

val childClass = module.packages.flatMap { it.classlikes }
.find { it.name == "Child" } as DClass
assertEquals(childClass.classlikes, emptyList())
}
}
}

@Test
fun `from kotlin to java`() {
testInline(
Expand Down

0 comments on commit fbe0968

Please sign in to comment.