From 0406a6bce4f461f3ae846911505701324411fa9b Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Wed, 11 Mar 2015 20:45:21 +0100 Subject: add test to verify that dokka recognizes secondary constructors --- test/data/classes/secondaryConstructor.kt | 5 +++++ test/src/model/ClassTest.kt | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 test/data/classes/secondaryConstructor.kt diff --git a/test/data/classes/secondaryConstructor.kt b/test/data/classes/secondaryConstructor.kt new file mode 100644 index 00000000..e5cb2557 --- /dev/null +++ b/test/data/classes/secondaryConstructor.kt @@ -0,0 +1,5 @@ +class C() { + /** This is a secondary constructor. */ + constructor(s: String): this() { + } +} diff --git a/test/src/model/ClassTest.kt b/test/src/model/ClassTest.kt index 61af5361..0a8fc147 100644 --- a/test/src/model/ClassTest.kt +++ b/test/src/model/ClassTest.kt @@ -253,4 +253,15 @@ public class ClassTest { assertEquals(1, extensions.size()) } } + + Test fun secondaryConstructor() { + verifyPackageMember("test/data/classes/secondaryConstructor.kt") { cls -> + val constructors = cls.members(DocumentationNode.Kind.Constructor) + assertEquals(2, constructors.size()) + with (constructors.first { it.details(DocumentationNode.Kind.Parameter).size()== 1}) { + assertEquals("", name) + assertEquals("This is a secondary constructor.", summary.toTestString()) + } + } + } } -- cgit