diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/data/functions/function.kt | 2 | ||||
-rw-r--r-- | test/data/functions/functionWithParams.kt | 4 | ||||
-rw-r--r-- | test/data/packages/dottedNamePackage.kt | 1 | ||||
-rw-r--r-- | test/data/packages/rootPackage.kt | 0 | ||||
-rw-r--r-- | test/data/packages/simpleNamePackage.kt | 1 | ||||
-rw-r--r-- | test/src/PackageTest.kt | 43 | ||||
-rw-r--r-- | test/src/TopLevelFunctionTest.kt | 8 |
7 files changed, 55 insertions, 4 deletions
diff --git a/test/data/functions/function.kt b/test/data/functions/function.kt index 878b017b..f8c64f94 100644 --- a/test/data/functions/function.kt +++ b/test/data/functions/function.kt @@ -1,4 +1,4 @@ /** - * doc + * Function fn */ fun fn() {}
\ No newline at end of file diff --git a/test/data/functions/functionWithParams.kt b/test/data/functions/functionWithParams.kt index 9d3a0ad7..135ed399 100644 --- a/test/data/functions/functionWithParams.kt +++ b/test/data/functions/functionWithParams.kt @@ -1,4 +1,6 @@ /** - * doc + * Multiline + * Function + * Documentation */ fun function(x : Int) {}
\ No newline at end of file diff --git a/test/data/packages/dottedNamePackage.kt b/test/data/packages/dottedNamePackage.kt new file mode 100644 index 00000000..38619310 --- /dev/null +++ b/test/data/packages/dottedNamePackage.kt @@ -0,0 +1 @@ +package dot.name
\ No newline at end of file diff --git a/test/data/packages/rootPackage.kt b/test/data/packages/rootPackage.kt new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/data/packages/rootPackage.kt diff --git a/test/data/packages/simpleNamePackage.kt b/test/data/packages/simpleNamePackage.kt new file mode 100644 index 00000000..2c29f4c7 --- /dev/null +++ b/test/data/packages/simpleNamePackage.kt @@ -0,0 +1 @@ +package simple 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()) |