From f36d9b0e4f336de7e35dcfa33934ab287b76d964 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Wed, 14 Jan 2015 19:38:58 +0100 Subject: show default values of parameters in generated documentation --- test/src/format/MarkdownFormatTest.kt | 6 ++++++ test/src/model/FunctionTest.kt | 14 ++++++++++++++ 2 files changed, 20 insertions(+) (limited to 'test/src') diff --git a/test/src/format/MarkdownFormatTest.kt b/test/src/format/MarkdownFormatTest.kt index 580acd7c..65713891 100644 --- a/test/src/format/MarkdownFormatTest.kt +++ b/test/src/format/MarkdownFormatTest.kt @@ -69,4 +69,10 @@ public class MarkdownFormatTest { } } + + 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) + } + } + } + } + } } -- cgit