diff options
Diffstat (limited to 'test/src/model/KotlinAsJavaTest.kt')
-rw-r--r-- | test/src/model/KotlinAsJavaTest.kt | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/src/model/KotlinAsJavaTest.kt b/test/src/model/KotlinAsJavaTest.kt new file mode 100644 index 00000000..25ee5fad --- /dev/null +++ b/test/src/model/KotlinAsJavaTest.kt @@ -0,0 +1,32 @@ +package org.jetbrains.dokka.tests + +import org.jetbrains.dokka.DocumentationModule +import org.jetbrains.dokka.DocumentationNode +import org.jetbrains.dokka.KotlinAsJavaDocumentationBuilder +import org.junit.Test +import kotlin.test.assertEquals + +class KotlinAsJavaTest { + @Test fun function() { + verifyModelAsJava("test/data/functions/function.kt") { model -> + val pkg = model.members.single() + + val facadeClass = pkg.members.single { it.name == "FunctionKt" } + assertEquals(DocumentationNode.Kind.Class, facadeClass.kind) + + val fn = facadeClass.members.single() + assertEquals("fn", fn.name) + assertEquals(DocumentationNode.Kind.CompanionObjectFunction, fn.kind) + } + } +} + +fun verifyModelAsJava(source: String, + withJdk: Boolean = false, + withKotlinRuntime: Boolean = false, + verifier: (DocumentationModule) -> Unit) { + verifyModel(source, + withJdk = withJdk, withKotlinRuntime = withKotlinRuntime, + packageDocumentationBuilder = KotlinAsJavaDocumentationBuilder(), + verifier = verifier) +} |