aboutsummaryrefslogtreecommitdiff
path: root/test/src/FunctionTest.kt
diff options
context:
space:
mode:
Diffstat (limited to 'test/src/FunctionTest.kt')
-rw-r--r--test/src/FunctionTest.kt37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/src/FunctionTest.kt b/test/src/FunctionTest.kt
new file mode 100644
index 00000000..e8afe97b
--- /dev/null
+++ b/test/src/FunctionTest.kt
@@ -0,0 +1,37 @@
+package com.jetbrains.dokka.tests
+
+import org.junit.Test
+import kotlin.test.*
+import com.jetbrains.dokka.*
+
+
+public class FunctionTest {
+ Test fun function() {
+ verifyModel("test/data/functions/function.kt") { model ->
+ val item = model.nodes.single().members.single()
+ assertEquals(DocumentationNodeKind.Function, item.kind)
+ assertEquals("fn", item.name)
+ assertEquals("Function fn", item.doc)
+ assertTrue(item.details.none())
+ assertTrue(item.members.none())
+ assertTrue(item.links.none())
+ }
+ }
+
+ Test fun functionWithParams() {
+ verifyModel("test/data/functions/functionWithParams.kt") { model ->
+ val item = model.nodes.single().members.single()
+ assertEquals(DocumentationNodeKind.Function, item.kind)
+ assertEquals("function", item.name)
+ 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())
+ }
+ }
+} \ No newline at end of file