aboutsummaryrefslogtreecommitdiff
path: root/test/src
diff options
context:
space:
mode:
Diffstat (limited to 'test/src')
-rw-r--r--test/src/PackageTest.kt43
-rw-r--r--test/src/TopLevelFunctionTest.kt8
2 files changed, 49 insertions, 2 deletions
diff --git a/test/src/PackageTest.kt b/test/src/PackageTest.kt
new file mode 100644
index 00000000..411ea300
--- /dev/null
+++ b/test/src/PackageTest.kt
@@ -0,0 +1,43 @@
+package com.jetbrains.dokka.tests
+
+import org.junit.Test
+import kotlin.test.*
+import com.jetbrains.dokka.*
+
+public class PackageTest {
+ Test fun rootPackage() {
+ verifyFiles("test/data/packages/rootPackage.kt") { model ->
+ val item = model.nodes.single()
+ assertEquals(DocumentationNodeKind.Package, item.kind)
+ assertEquals("", item.name)
+ assertEquals("", item.doc)
+ assertTrue(item.details.none())
+ assertTrue(item.members.none())
+ assertTrue(item.links.none())
+ }
+ }
+
+ Test fun simpleNamePackage() {
+ verifyFiles("test/data/packages/simpleNamePackage.kt") { model ->
+ val item = model.nodes.single()
+ assertEquals(DocumentationNodeKind.Package, item.kind)
+ assertEquals("simple", item.name)
+ assertEquals("", item.doc)
+ assertTrue(item.details.none())
+ assertTrue(item.members.none())
+ assertTrue(item.links.none())
+ }
+ }
+
+ Test fun dottedNamePackage() {
+ verifyFiles("test/data/packages/dottedNamePackage.kt") { model ->
+ val item = model.nodes.single()
+ assertEquals(DocumentationNodeKind.Package, item.kind)
+ assertEquals("dot.name", item.name)
+ assertEquals("", item.doc)
+ assertTrue(item.details.none())
+ assertTrue(item.members.none())
+ assertTrue(item.links.none())
+ }
+ }
+} \ No newline at end of file
diff --git a/test/src/TopLevelFunctionTest.kt b/test/src/TopLevelFunctionTest.kt
index dd88a1a0..02150784 100644
--- a/test/src/TopLevelFunctionTest.kt
+++ b/test/src/TopLevelFunctionTest.kt
@@ -11,7 +11,7 @@ public class TopLevelFunctionTest {
val item = model.nodes.single().members.single()
assertEquals(DocumentationNodeKind.Function, item.kind)
assertEquals("fn", item.name)
- assertEquals("doc", item.doc)
+ assertEquals("Function fn", item.doc)
assertTrue(item.details.none())
assertTrue(item.members.none())
assertTrue(item.links.none())
@@ -23,8 +23,12 @@ public class TopLevelFunctionTest {
val item = model.nodes.single().members.single()
assertEquals(DocumentationNodeKind.Function, item.kind)
assertEquals("function", item.name)
- assertEquals("doc", item.doc)
+ assertEquals("""Multiline
+Function
+Documentation"""
+ , item.doc)
assertEquals("x", item.details.single().name)
+ assertEquals(DocumentationNodeKind.Parameter, item.details.single().kind)
assertTrue(item.members.none())
assertTrue(item.links.none())