From 207a66a54f65fc2bd40baff4b144e0df6bb2eb15 Mon Sep 17 00:00:00 2001 From: Valentin Rocher Date: Thu, 3 Dec 2020 10:33:23 +0100 Subject: exclude top-level const val from getter generation and show them as public and static (#1636) --- .../javadoc/JavadocClasslikeTemplateMapTest.kt | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'plugins/javadoc/src/test/kotlin/org/jetbrains') diff --git a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocClasslikeTemplateMapTest.kt b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocClasslikeTemplateMapTest.kt index f03b10b4..2fb1ae0e 100644 --- a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocClasslikeTemplateMapTest.kt +++ b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocClasslikeTemplateMapTest.kt @@ -316,6 +316,33 @@ internal class JavadocClasslikeTemplateMapTest : AbstractJavadocTemplateMapTest( } } + @Test + fun `class with top-level const`() { + dualTestTemplateMapInline( + kotlin = + """ + /src/Test.kt + package com.test.package0 + + const val TEST_VAL = "test" + """, + java = + """ + /src/com/test/package0/TestKt.java + package com.test.package0; + + public final class TestKt { + public static final String TEST_VAL = "test"; + } + """ + ) { + val map = singlePageOfType().templateMap + val properties = assertIsInstance>(map["properties"]) + val property = assertIsInstance>(properties.first()) + assertEquals("public final static String TEST_VAL", "${property["modifiers"]} ${property["signature"]}") + } + } + private fun assertParameterNode(node: Map, expectedName: String, expectedType: String, expectedDescription: String){ assertEquals(expectedName, node["name"]) assertEquals(expectedType, node["type"]) -- cgit