aboutsummaryrefslogtreecommitdiff
path: root/core/src/test
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2016-04-28 17:18:51 +0200
committerDmitry Jemerov <yole@jetbrains.com>2016-04-28 17:18:51 +0200
commit25278e2697af68788f8efdbe32b29f0ed42f33b4 (patch)
tree1409c0d3059ef2bf006a3a754aed92eec36e815e /core/src/test
parent1574339f6950c8662e9b480dc0c3f63403bfdfab (diff)
downloaddokka-25278e2697af68788f8efdbe32b29f0ed42f33b4.tar.gz
dokka-25278e2697af68788f8efdbe32b29f0ed42f33b4.tar.bz2
dokka-25278e2697af68788f8efdbe32b29f0ed42f33b4.zip
add test to ensure that @receiver is rendered
Diffstat (limited to 'core/src/test')
-rw-r--r--core/src/test/kotlin/format/MarkdownFormatTest.kt13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/src/test/kotlin/format/MarkdownFormatTest.kt b/core/src/test/kotlin/format/MarkdownFormatTest.kt
index ad1932b1..84bf082b 100644
--- a/core/src/test/kotlin/format/MarkdownFormatTest.kt
+++ b/core/src/test/kotlin/format/MarkdownFormatTest.kt
@@ -242,6 +242,13 @@ class MarkdownFormatTest {
verifyMarkdownNodeByName("receiverParameterTypeBound", "Foo")
}
+ @Test fun extensionWithDocumentedReceiver() {
+ verifyOutput("testdata/format/extensionWithDocumentedReceiver.kt", ".md") { model, output ->
+ val nodesWithName = model.members.single().members.single().members.filter { it.name == "fn" }
+ markdownService.appendNodes(tempLocation, output, nodesWithName)
+ }
+ }
+
@Test fun jdkLinks() {
verifyMarkdownNode("jdkLinks", withKotlinRuntime = true)
}
@@ -264,7 +271,11 @@ class MarkdownFormatTest {
private fun verifyMarkdownNodeByName(fileName: String, name: String) {
verifyOutput("testdata/format/$fileName.kt", ".md") { model, output ->
- markdownService.appendNodes(tempLocation, output, model.members.single().members.filter { it.name == name })
+ val nodesWithName = model.members.single().members.filter { it.name == name }
+ if (nodesWithName.isEmpty()) {
+ throw IllegalArgumentException("Found no nodes named $name")
+ }
+ markdownService.appendNodes(tempLocation, output, nodesWithName)
}
}
}