aboutsummaryrefslogtreecommitdiff
path: root/plugins/javadoc/src/test/kotlin/org/jetbrains
diff options
context:
space:
mode:
authorValentin Rocher <bishiboosh@gmail.com>2020-12-03 10:33:23 +0100
committerGitHub <noreply@github.com>2020-12-03 10:33:23 +0100
commit207a66a54f65fc2bd40baff4b144e0df6bb2eb15 (patch)
tree861ba7da33f0aa02902c071368688ab65b221669 /plugins/javadoc/src/test/kotlin/org/jetbrains
parent254f319aadf9327261da7c623fb22a632ce9bab8 (diff)
downloaddokka-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/javadoc/src/test/kotlin/org/jetbrains')
-rw-r--r--plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocClasslikeTemplateMapTest.kt27
1 files changed, 27 insertions, 0 deletions
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<JavadocClasslikePageNode>().templateMap
+ val properties = assertIsInstance<List<*>>(map["properties"])
+ val property = assertIsInstance<Map<String, Any?>>(properties.first())
+ assertEquals("public final static <a href=https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>String</a> <a href=TestKt.html#TEST_VAL>TEST_VAL</a>", "${property["modifiers"]} ${property["signature"]}")
+ }
+ }
+
private fun assertParameterNode(node: Map<String, Any?>, expectedName: String, expectedType: String, expectedDescription: String){
assertEquals(expectedName, node["name"])
assertEquals(expectedType, node["type"])