aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-07-11 22:29:47 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-07-11 22:29:47 +0400
commitcec0fc9f3eaa5df8fc2654ce90d87b9be48b16c0 (patch)
treef019f9483bad3726661609f5e1b3c4a466cb0034 /test
parent09935fc1657670eaa8beb1b56718ed267404d7db (diff)
downloaddokka-cec0fc9f3eaa5df8fc2654ce90d87b9be48b16c0.tar.gz
dokka-cec0fc9f3eaa5df8fc2654ce90d87b9be48b16c0.tar.bz2
dokka-cec0fc9f3eaa5df8fc2654ce90d87b9be48b16c0.zip
Support functions with receivers.
Diffstat (limited to 'test')
-rw-r--r--test/data/functions/functionWithReceiver.kt5
-rw-r--r--test/src/model/FunctionTest.kt20
2 files changed, 25 insertions, 0 deletions
diff --git a/test/data/functions/functionWithReceiver.kt b/test/data/functions/functionWithReceiver.kt
new file mode 100644
index 00000000..663c3e56
--- /dev/null
+++ b/test/data/functions/functionWithReceiver.kt
@@ -0,0 +1,5 @@
+/**
+ * Function with receiver
+ */
+fun String.fn() {
+} \ No newline at end of file
diff --git a/test/src/model/FunctionTest.kt b/test/src/model/FunctionTest.kt
index 20ae390c..217e97f4 100644
--- a/test/src/model/FunctionTest.kt
+++ b/test/src/model/FunctionTest.kt
@@ -18,6 +18,26 @@ public class FunctionTest {
}
}
+ Test fun functionWithReceiver() {
+ verifyModel("test/data/functions/functionWithReceiver.kt") { model ->
+ with(model.nodes.single().members.single()) {
+ assertEquals("fn", name)
+ assertEquals(DocumentationNodeKind.Function, kind)
+ assertEquals("Function with receiver", doc)
+ with(details.single()) {
+ assertEquals("<this>", name)
+ assertEquals(DocumentationNodeKind.Receiver, kind)
+ assertEquals("", doc)
+ assertTrue(details.none())
+ assertTrue(members.none())
+ assertTrue(links.none())
+ }
+ assertTrue(members.none())
+ assertTrue(links.none())
+ }
+ }
+ }
+
Test fun genericFunction() {
verifyModel("test/data/functions/genericFunction.kt") { model ->
with(model.nodes.single().members.single()) {