diff options
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/test/kotlin/format/MarkdownFormatTest.kt | 13 |
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) } } } |