diff options
author | Valentin Rocher <bishiboosh@gmail.com> | 2020-12-03 10:33:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-03 10:33:23 +0100 |
commit | 207a66a54f65fc2bd40baff4b144e0df6bb2eb15 (patch) | |
tree | 861ba7da33f0aa02902c071368688ab65b221669 /plugins/kotlin-as-java/src/test/kotlin | |
parent | 254f319aadf9327261da7c623fb22a632ce9bab8 (diff) | |
download | dokka-207a66a54f65fc2bd40baff4b144e0df6bb2eb15.tar.gz dokka-207a66a54f65fc2bd40baff4b144e0df6bb2eb15.tar.bz2 dokka-207a66a54f65fc2bd40baff4b144e0df6bb2eb15.zip |
exclude top-level const val from getter generation and show them as public and static (#1636)
Diffstat (limited to 'plugins/kotlin-as-java/src/test/kotlin')
-rw-r--r-- | plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt | 32 |
1 files changed, 32 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 7def1111..5430ea88 100644 --- a/plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt +++ b/plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt @@ -8,6 +8,7 @@ import org.junit.jupiter.api.Test import matchers.content.* import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.jdk +import org.junit.Assert import signatures.renderedContent import signatures.signature import utils.A @@ -372,6 +373,37 @@ class KotlinAsJavaPluginTest : BaseAbstractTest() { } } } + + @Test + fun `const in top level`() { + val writerPlugin = TestOutputWriterPlugin() + val configuration = dokkaConfiguration { + sourceSets { + sourceSet { + sourceRoots = listOf("src/") + externalDocumentationLinks = listOf( + DokkaConfiguration.ExternalDocumentationLink.jdk(8), + stdlibExternalDocumentationLink + ) + } + } + } + testInline( + """ + |/src/main/kotlin/kotlinAsJavaPlugin/Test.kt + |package kotlinAsJavaPlugin + | + |const val FIRST = "String" + """.trimMargin(), + configuration, + pluginOverrides = listOf(writerPlugin), + cleanupOutput = true + ) { + renderingStage = { _, _ -> + Assert.assertNull(writerPlugin.writer.contents["root/kotlinAsJavaPlugin/-test-kt/get-f-i-r-s-t.html"]) + } + } + } } private val ContentNode.mainContents: List<ContentNode> |