diff options
author | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-07-11 22:25:01 +0400 |
---|---|---|
committer | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-07-11 22:25:01 +0400 |
commit | 09935fc1657670eaa8beb1b56718ed267404d7db (patch) | |
tree | d43ad32d8a29fa0e0d73de641b4f459463b16e30 /test | |
parent | b511259a37aa9feee06a3ca92b7967552aa34104 (diff) | |
download | dokka-09935fc1657670eaa8beb1b56718ed267404d7db.tar.gz dokka-09935fc1657670eaa8beb1b56718ed267404d7db.tar.bz2 dokka-09935fc1657670eaa8beb1b56718ed267404d7db.zip |
Support type parameter constraints as type parameter details.
Diffstat (limited to 'test')
-rw-r--r-- | test/data/functions/genericFunctionWithConstraints.kt | 6 | ||||
-rw-r--r-- | test/src/model/FunctionTest.kt | 28 |
2 files changed, 34 insertions, 0 deletions
diff --git a/test/data/functions/genericFunctionWithConstraints.kt b/test/data/functions/genericFunctionWithConstraints.kt new file mode 100644 index 00000000..11598ae7 --- /dev/null +++ b/test/data/functions/genericFunctionWithConstraints.kt @@ -0,0 +1,6 @@ + +/** + * generic function + */ +fun <T : CharSequence> generic() { +}
\ No newline at end of file diff --git a/test/src/model/FunctionTest.kt b/test/src/model/FunctionTest.kt index c2a444b9..20ae390c 100644 --- a/test/src/model/FunctionTest.kt +++ b/test/src/model/FunctionTest.kt @@ -39,6 +39,34 @@ public class FunctionTest { } } } + Test fun genericFunctionWithConstraints() { + verifyModel("test/data/functions/genericFunctionWithConstraints.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) + with(details.single()) { + assertEquals("CharSequence", name) + assertEquals(DocumentationNodeKind.UpperBound, kind) + assertEquals("", doc) + assertTrue(details.none()) + assertTrue(members.none()) + assertTrue(links.none()) + } + assertTrue(members.none()) + assertTrue(links.none()) + } + + assertTrue(members.none()) + assertTrue(links.none()) + } + } + } Test fun functionWithParams() { verifyModel("test/data/functions/functionWithParams.kt") { model -> |