diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/data/classes/classWithClassObject.kt | 7 | ||||
-rw-r--r-- | test/src/model/ClassTest.kt | 32 |
2 files changed, 38 insertions, 1 deletions
diff --git a/test/data/classes/classWithClassObject.kt b/test/data/classes/classWithClassObject.kt new file mode 100644 index 00000000..459efad6 --- /dev/null +++ b/test/data/classes/classWithClassObject.kt @@ -0,0 +1,7 @@ +class Klass() { + class object { + val x = 1 + + fun foo() {} + } +} diff --git a/test/src/model/ClassTest.kt b/test/src/model/ClassTest.kt index 65363c92..b95a31dc 100644 --- a/test/src/model/ClassTest.kt +++ b/test/src/model/ClassTest.kt @@ -136,4 +136,34 @@ public class ClassTest { } } } -}
\ No newline at end of file + + Test fun classWithClassObject() { + verifyModel("test/data/classes/classWithClassObject.kt") { model -> + with(model.members.single().members.single()) { + assertEquals(DocumentationNode.Kind.Class, kind) + assertEquals("Klass", name) + assertEquals(Content.Empty, content) + assertEquals(2, details.count()) + assertTrue(links.none()) + + assertEquals(3, members.count()) + with(members.elementAt(0)) { + assertEquals("<init>", name) + assertEquals(Content.Empty, content) + } + with(members.elementAt(1)) { + assertEquals("x", name) + assertEquals(DocumentationNode.Kind.ClassObjectProperty, kind) + assertTrue(members.none()) + assertTrue(links.none()) + } + with(members.elementAt(2)) { + assertEquals("foo", name) + assertEquals(DocumentationNode.Kind.ClassObjectFunction, kind) + assertTrue(members.none()) + assertTrue(links.none()) + } + } + } + } +} |