diff options
author | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-07-11 18:44:53 +0400 |
---|---|---|
committer | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-07-11 18:44:53 +0400 |
commit | 35b64fb01d6b4da4b0dab840a787abc84d1bff06 (patch) | |
tree | 6733eeb9f157188d0b7f935e8fecaf97707b8139 /test | |
parent | c540bc28a79092b212e575fa18d33399faee83b9 (diff) | |
download | dokka-35b64fb01d6b4da4b0dab840a787abc84d1bff06.tar.gz dokka-35b64fb01d6b4da4b0dab840a787abc84d1bff06.tar.bz2 dokka-35b64fb01d6b4da4b0dab840a787abc84d1bff06.zip |
Build model using recursive visitor, include packages in model, add test for function with parameters, unify model and node.
Diffstat (limited to 'test')
-rw-r--r-- | test/data/functions/function.kt (renamed from test/data/function.kt) | 0 | ||||
-rw-r--r-- | test/data/functions/functionWithParams.kt | 4 | ||||
-rw-r--r-- | test/src/TopLevelFunctionTest.kt | 17 |
3 files changed, 19 insertions, 2 deletions
diff --git a/test/data/function.kt b/test/data/functions/function.kt index 878b017b..878b017b 100644 --- a/test/data/function.kt +++ b/test/data/functions/function.kt diff --git a/test/data/functions/functionWithParams.kt b/test/data/functions/functionWithParams.kt new file mode 100644 index 00000000..9d3a0ad7 --- /dev/null +++ b/test/data/functions/functionWithParams.kt @@ -0,0 +1,4 @@ +/** + * doc + */ +fun function(x : Int) {}
\ No newline at end of file diff --git a/test/src/TopLevelFunctionTest.kt b/test/src/TopLevelFunctionTest.kt index a51b7bdd..dd88a1a0 100644 --- a/test/src/TopLevelFunctionTest.kt +++ b/test/src/TopLevelFunctionTest.kt @@ -7,8 +7,8 @@ import com.jetbrains.dokka.* public class TopLevelFunctionTest { Test fun function() { - verifyFiles("test/data/function.kt") { model -> - val item = model.nodes.single() + verifyFiles("test/data/functions/function.kt") { model -> + val item = model.nodes.single().members.single() assertEquals(DocumentationNodeKind.Function, item.kind) assertEquals("fn", item.name) assertEquals("doc", item.doc) @@ -17,4 +17,17 @@ public class TopLevelFunctionTest { assertTrue(item.links.none()) } } + + Test fun functionWithParams() { + verifyFiles("test/data/functions/functionWithParams.kt") { model -> + val item = model.nodes.single().members.single() + assertEquals(DocumentationNodeKind.Function, item.kind) + assertEquals("function", item.name) + assertEquals("doc", item.doc) + assertEquals("x", item.details.single().name) + + assertTrue(item.members.none()) + assertTrue(item.links.none()) + } + } }
\ No newline at end of file |