aboutsummaryrefslogtreecommitdiff
path: root/test/src/model/FunctionTest.kt
diff options
context:
space:
mode:
Diffstat (limited to 'test/src/model/FunctionTest.kt')
-rw-r--r--test/src/model/FunctionTest.kt43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/src/model/FunctionTest.kt b/test/src/model/FunctionTest.kt
new file mode 100644
index 00000000..90b937de
--- /dev/null
+++ b/test/src/model/FunctionTest.kt
@@ -0,0 +1,43 @@
+package org.jetbrains.dokka.tests
+
+import org.junit.Test
+import kotlin.test.*
+import org.jetbrains.dokka.*
+
+public class FunctionTest {
+ Test fun function() {
+ verifyModel("test/data/functions/function.kt") { model ->
+ with(model.nodes.single().members.single()) {
+ assertEquals("fn", name)
+ assertEquals(DocumentationNodeKind.Function, kind)
+ assertEquals("Function fn", doc)
+ assertTrue(details.none())
+ assertTrue(members.none())
+ assertTrue(links.none())
+ }
+ }
+ }
+
+ Test fun functionWithParams() {
+ verifyModel("test/data/functions/functionWithParams.kt") { model ->
+ with(model.nodes.single().members.single()) {
+ assertEquals("function", name)
+ assertEquals(DocumentationNodeKind.Function, kind)
+ assertEquals("""Multiline
+Function
+Documentation"""
+ , doc)
+ with(details.single()) {
+ assertEquals("x", name)
+ assertEquals(DocumentationNodeKind.Parameter, kind)
+ assertTrue(details.none())
+ assertTrue(members.none())
+ assertTrue(links.none())
+ }
+
+ assertTrue(members.none())
+ assertTrue(links.none())
+ }
+ }
+ }
+} \ No newline at end of file