diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/data/classes/classWithConstructor.kt | 1 | ||||
-rw-r--r-- | test/data/classes/classWithFunction.kt | 4 | ||||
-rw-r--r-- | test/data/classes/emptyClass.kt | 3 | ||||
-rw-r--r-- | test/data/functions/function.kt | 3 | ||||
-rw-r--r-- | test/data/functions/functionWithParams.kt | 3 | ||||
-rw-r--r-- | test/src/ClassTest.kt | 43 | ||||
-rw-r--r-- | test/src/FunctionTest.kt (renamed from test/src/TopLevelFunctionTest.kt) | 2 |
7 files changed, 56 insertions, 3 deletions
diff --git a/test/data/classes/classWithConstructor.kt b/test/data/classes/classWithConstructor.kt new file mode 100644 index 00000000..0751d570 --- /dev/null +++ b/test/data/classes/classWithConstructor.kt @@ -0,0 +1 @@ +class Klass(name: String)
\ No newline at end of file diff --git a/test/data/classes/classWithFunction.kt b/test/data/classes/classWithFunction.kt new file mode 100644 index 00000000..a981cfb6 --- /dev/null +++ b/test/data/classes/classWithFunction.kt @@ -0,0 +1,4 @@ +class Klass { + fun fn() { + } +} diff --git a/test/data/classes/emptyClass.kt b/test/data/classes/emptyClass.kt new file mode 100644 index 00000000..abd20cc8 --- /dev/null +++ b/test/data/classes/emptyClass.kt @@ -0,0 +1,3 @@ +class Klass { + +}
\ No newline at end of file diff --git a/test/data/functions/function.kt b/test/data/functions/function.kt index f8c64f94..3ed81dfa 100644 --- a/test/data/functions/function.kt +++ b/test/data/functions/function.kt @@ -1,4 +1,5 @@ /** * Function fn */ -fun fn() {}
\ No newline at end of file +fun fn() { +}
\ No newline at end of file diff --git a/test/data/functions/functionWithParams.kt b/test/data/functions/functionWithParams.kt index 135ed399..559f4f78 100644 --- a/test/data/functions/functionWithParams.kt +++ b/test/data/functions/functionWithParams.kt @@ -3,4 +3,5 @@ * Function * Documentation */ -fun function(x : Int) {}
\ No newline at end of file +fun function(x: Int) { +}
\ No newline at end of file diff --git a/test/src/ClassTest.kt b/test/src/ClassTest.kt new file mode 100644 index 00000000..914df53b --- /dev/null +++ b/test/src/ClassTest.kt @@ -0,0 +1,43 @@ +package com.jetbrains.dokka.tests + +import org.junit.Test +import kotlin.test.* +import com.jetbrains.dokka.* + +public class ClassTest { + Test fun emptyClass() { + verifyModel("test/data/classes/emptyClass.kt") { model -> + val item = model.nodes.single().members.single() + assertEquals(DocumentationNodeKind.Class, item.kind) + assertEquals("Klass", item.name) + assertEquals("", item.doc) + assertTrue(item.details.none()) + assertEquals("<init>", item.members.single().name) + assertTrue(item.links.none()) + } + } + + Test fun classWithConstructor() { + verifyModel("test/data/classes/classWithConstructor.kt") { model -> + val item = model.nodes.single().members.single() + assertEquals(DocumentationNodeKind.Class, item.kind) + assertEquals("Klass", item.name) + assertEquals("", item.doc) + assertTrue(item.details.none()) + assertEquals("<init>", item.members.single().name) + assertTrue(item.links.none()) + } + } + + Test fun classWithFunction() { + verifyModel("test/data/classes/classWithFunction.kt") { model -> + val item = model.nodes.single().members.single() + assertEquals(DocumentationNodeKind.Class, item.kind) + assertEquals("Klass", item.name) + assertEquals("", item.doc) + assertTrue(item.details.none()) + assertEquals("<init>", item.members.single().name) + assertTrue(item.links.none()) + } + } +}
\ No newline at end of file diff --git a/test/src/TopLevelFunctionTest.kt b/test/src/FunctionTest.kt index 342708f2..e8afe97b 100644 --- a/test/src/TopLevelFunctionTest.kt +++ b/test/src/FunctionTest.kt @@ -5,7 +5,7 @@ import kotlin.test.* import com.jetbrains.dokka.* -public class TopLevelFunctionTest { +public class FunctionTest { Test fun function() { verifyModel("test/data/functions/function.kt") { model -> val item = model.nodes.single().members.single() |