diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/data/format/functionWithDefaultParameter.kt | 1 | ||||
-rw-r--r-- | test/data/format/functionWithDefaultParameter.md | 12 | ||||
-rw-r--r-- | test/data/functions/functionWithDefaultParameter.kt | 1 | ||||
-rw-r--r-- | test/src/format/MarkdownFormatTest.kt | 6 | ||||
-rw-r--r-- | test/src/model/FunctionTest.kt | 14 |
5 files changed, 34 insertions, 0 deletions
diff --git a/test/data/format/functionWithDefaultParameter.kt b/test/data/format/functionWithDefaultParameter.kt new file mode 100644 index 00000000..3a3a102f --- /dev/null +++ b/test/data/format/functionWithDefaultParameter.kt @@ -0,0 +1 @@ +fun f(x: String = "") {} diff --git a/test/data/format/functionWithDefaultParameter.md b/test/data/format/functionWithDefaultParameter.md new file mode 100644 index 00000000..1acab0ef --- /dev/null +++ b/test/data/format/functionWithDefaultParameter.md @@ -0,0 +1,12 @@ +[test](out.md) / [](out.md) / [f](out.md) + + +# f + + +``` +fun f(x: String = ""): Unit +``` + + + diff --git a/test/data/functions/functionWithDefaultParameter.kt b/test/data/functions/functionWithDefaultParameter.kt new file mode 100644 index 00000000..3a3a102f --- /dev/null +++ b/test/data/functions/functionWithDefaultParameter.kt @@ -0,0 +1 @@ +fun f(x: String = "") {} diff --git a/test/src/format/MarkdownFormatTest.kt b/test/src/format/MarkdownFormatTest.kt index 293b9cb2..5a4bacb2 100644 --- a/test/src/format/MarkdownFormatTest.kt +++ b/test/src/format/MarkdownFormatTest.kt @@ -75,4 +75,10 @@ public class MarkdownFormatTest { markdownService.appendNodes(tempLocation, output, model.members.single().members) } } + + Test fun functionWithDefaultParameter() { + verifyOutput("test/data/format/functionWithDefaultParameter.kt", ".md") { model, output -> + markdownService.appendNodes(tempLocation, output, model.members.single().members) + } + } } diff --git a/test/src/model/FunctionTest.kt b/test/src/model/FunctionTest.kt index 299f33a8..c648cb55 100644 --- a/test/src/model/FunctionTest.kt +++ b/test/src/model/FunctionTest.kt @@ -194,4 +194,18 @@ Documentation""", content.description.toTestString()) } } } + + Test fun functionWithDefaultParameter() { + verifyModel("test/data/functions/functionWithDefaultParameter.kt") { model -> + with(model.members.single().members.single()) { + with(details.elementAt(2)) { + val value = details(DocumentationNode.Kind.Value) + assertEquals(1, value.count()) + with(value[0]) { + assertEquals("\"\"", name) + } + } + } + } + } } |