aboutsummaryrefslogtreecommitdiff
path: root/test/src/model/PropertyTest.kt
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-10-12 22:35:47 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-10-12 22:35:47 +0400
commit11355cefc9f6856054cb3760d2a339f40d22dae3 (patch)
tree8b3abf314cd517c7c0136ad5a2334b2140d69cf7 /test/src/model/PropertyTest.kt
parentcf272252a8e62d7b212e9025065a8bce4f514946 (diff)
downloaddokka-11355cefc9f6856054cb3760d2a339f40d22dae3.tar.gz
dokka-11355cefc9f6856054cb3760d2a339f40d22dae3.tar.bz2
dokka-11355cefc9f6856054cb3760d2a339f40d22dae3.zip
Convert visitors to top-down builder
Diffstat (limited to 'test/src/model/PropertyTest.kt')
-rw-r--r--test/src/model/PropertyTest.kt28
1 files changed, 12 insertions, 16 deletions
diff --git a/test/src/model/PropertyTest.kt b/test/src/model/PropertyTest.kt
index ed49bd6b..cac62194 100644
--- a/test/src/model/PropertyTest.kt
+++ b/test/src/model/PropertyTest.kt
@@ -58,18 +58,10 @@ public class PropertyTest {
assertEquals(DocumentationNode.Kind.Property, kind)
assertEquals(Content.Empty, doc)
assertEquals(3, details.count())
- with(details.elementAt(0)) {
- assertEquals(DocumentationNode.Kind.Type, kind)
- assertEquals("String", name)
- }
- with(details.elementAt(1)) {
- assertEquals(DocumentationNode.Kind.Modifier, kind)
- assertEquals("final", name)
- }
- with(details.elementAt(2)) {
- assertEquals(DocumentationNode.Kind.Modifier, kind)
- assertEquals("internal", name)
- }
+ assertEquals("String", detail(DocumentationNode.Kind.Type).name)
+ val modifiers = details(DocumentationNode.Kind.Modifier).map { it.name }
+ assertTrue("final" in modifiers)
+ assertTrue("internal" in modifiers)
assertTrue(links.none())
assertEquals(2, members.count())
@@ -77,6 +69,9 @@ public class PropertyTest {
assertEquals("<get-property>", name)
assertEquals(DocumentationNode.Kind.Function, kind)
assertEquals(Content.Empty, doc)
+ val get_modifiers = details(DocumentationNode.Kind.Modifier).map { it.name }
+ assertTrue("final" in get_modifiers)
+ assertTrue("internal" in get_modifiers)
assertEquals("String", detail(DocumentationNode.Kind.Type).name)
assertTrue(links.none())
assertTrue(members.none())
@@ -86,10 +81,11 @@ public class PropertyTest {
assertEquals(DocumentationNode.Kind.Function, kind)
assertEquals(Content.Empty, doc)
assertEquals(4, details.count())
- assertEquals("Unit", details.elementAt(0).name)
- assertEquals("final", details.elementAt(1).name)
- assertEquals("internal", details.elementAt(2).name)
- with(details.elementAt(3)) {
+ assertEquals("Unit", detail(DocumentationNode.Kind.Type).name)
+ val set_modifiers = details(DocumentationNode.Kind.Modifier).map { it.name }
+ assertTrue("final" in set_modifiers)
+ assertTrue("internal" in set_modifiers)
+ with(detail(DocumentationNode.Kind.Parameter)) {
assertEquals("value", name)
assertEquals(DocumentationNode.Kind.Parameter, kind)
assertEquals(Content.Empty, doc)