aboutsummaryrefslogtreecommitdiff
path: root/core/src/test
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-11-23 19:50:49 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-11-23 19:50:49 +0300
commitb0310f8f3e242ffc64c56e8fd95710b25b37dfff (patch)
treead985b6fdc7161ef4ef0fa39789a1f11acd904a6 /core/src/test
parentb9fa0e0741bfdfa76c3929e5343a2b19d96fc1ff (diff)
downloaddokka-b0310f8f3e242ffc64c56e8fd95710b25b37dfff.tar.gz
dokka-b0310f8f3e242ffc64c56e8fd95710b25b37dfff.tar.bz2
dokka-b0310f8f3e242ffc64c56e8fd95710b25b37dfff.zip
Fix constant values for Java
Diffstat (limited to 'core/src/test')
-rw-r--r--core/src/test/kotlin/model/KotlinAsJavaTest.kt20
1 files changed, 20 insertions, 0 deletions
diff --git a/core/src/test/kotlin/model/KotlinAsJavaTest.kt b/core/src/test/kotlin/model/KotlinAsJavaTest.kt
index d24d8bdd..22818038 100644
--- a/core/src/test/kotlin/model/KotlinAsJavaTest.kt
+++ b/core/src/test/kotlin/model/KotlinAsJavaTest.kt
@@ -2,6 +2,8 @@ package org.jetbrains.dokka.tests
import org.jetbrains.dokka.DocumentationModule
import org.jetbrains.dokka.NodeKind
+import org.jetbrains.dokka.RefKind
+import org.junit.Assert
import org.junit.Test
import org.junit.Assert.assertEquals
@@ -27,6 +29,24 @@ class KotlinAsJavaTest {
assertEquals("doc", getter.content.summary.toTestString())
}
}
+
+
+ @Test fun constants() {
+ verifyModelAsJava("testdata/java/constants.java") { cls ->
+ selectNodes(cls) {
+ subgraphOf(RefKind.Member)
+ matching { it.name == "constStr" || it.name == "refConst" }
+ }.forEach {
+ assertEquals("In $it", "\"some value\"", it.detailOrNull(NodeKind.Value)?.name)
+ }
+ val nullConstNode = selectNodes(cls) {
+ subgraphOf(RefKind.Member)
+ withName("nullConst")
+ }.single()
+
+ Assert.assertNull(nullConstNode.detailOrNull(NodeKind.Value))
+ }
+ }
}
fun verifyModelAsJava(source: String,