aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/data/functions/genericFunctionWithConstraints.kt6
-rw-r--r--test/src/model/FunctionTest.kt28
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 ->