aboutsummaryrefslogtreecommitdiff
path: root/test/src
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-07-11 22:09:41 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-07-11 22:09:41 +0400
commitb511259a37aa9feee06a3ca92b7967552aa34104 (patch)
tree683946a6e0868c10e95f814ec8996b99a9fab08d /test/src
parentc0f820f4a4dfddbee06cb4c62a3b4609611dac62 (diff)
downloaddokka-b511259a37aa9feee06a3ca92b7967552aa34104.tar.gz
dokka-b511259a37aa9feee06a3ca92b7967552aa34104.tar.bz2
dokka-b511259a37aa9feee06a3ca92b7967552aa34104.zip
Support type parameters for functions and classes.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/model/ClassTest.kt22
-rw-r--r--test/src/model/FunctionTest.kt22
2 files changed, 44 insertions, 0 deletions
diff --git a/test/src/model/ClassTest.kt b/test/src/model/ClassTest.kt
index 708a1798..82d24f16 100644
--- a/test/src/model/ClassTest.kt
+++ b/test/src/model/ClassTest.kt
@@ -18,6 +18,28 @@ public class ClassTest {
}
}
+ Test fun genericClass() {
+ verifyModel("test/data/classes/genericClass.kt") { model ->
+ with(model.nodes.single().members.single()) {
+ assertEquals(DocumentationNodeKind.Class, kind)
+ assertEquals("Klass", name)
+ assertEquals("", doc)
+
+ with(details.single()) {
+ assertEquals("T", name)
+ assertEquals(DocumentationNodeKind.TypeParameter, kind)
+ assertEquals("", doc)
+ assertTrue(details.none())
+ assertTrue(members.none())
+ assertTrue(links.none())
+ }
+
+ assertEquals("<init>", members.single().name)
+ assertTrue(links.none())
+ }
+ }
+ }
+
Test fun emptyObject() {
verifyModel("test/data/classes/emptyObject.kt") { model ->
with(model.nodes.single().members.single()) {
diff --git a/test/src/model/FunctionTest.kt b/test/src/model/FunctionTest.kt
index 528166e6..c2a444b9 100644
--- a/test/src/model/FunctionTest.kt
+++ b/test/src/model/FunctionTest.kt
@@ -18,6 +18,28 @@ public class FunctionTest {
}
}
+ Test fun genericFunction() {
+ verifyModel("test/data/functions/genericFunction.kt") { model ->
+ with(model.nodes.single().members.single()) {
+ assertEquals("generic", name)
+ assertEquals(DocumentationNodeKind.Function, kind)
+ assertEquals("generic function", doc)
+
+ with(details.single()) {
+ assertEquals("T", name)
+ assertEquals(DocumentationNodeKind.TypeParameter, kind)
+ assertEquals("", doc)
+ assertTrue(details.none())
+ assertTrue(members.none())
+ assertTrue(links.none())
+ }
+
+ assertTrue(members.none())
+ assertTrue(links.none())
+ }
+ }
+ }
+
Test fun functionWithParams() {
verifyModel("test/data/functions/functionWithParams.kt") { model ->
with(model.nodes.single().members.single()) {