aboutsummaryrefslogtreecommitdiff
path: root/test/src/TestAPI.kt
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-02-10 18:32:12 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-02-10 18:32:12 +0100
commit0d0fc1f2bf8f09106e53626bc024298dc91361b8 (patch)
tree7364f5a98dacdad3524389c0d818b32ab2641009 /test/src/TestAPI.kt
parent92075236fb1356fe6023edff1e43fe3125b76c18 (diff)
downloaddokka-0d0fc1f2bf8f09106e53626bc024298dc91361b8.tar.gz
dokka-0d0fc1f2bf8f09106e53626bc024298dc91361b8.tar.bz2
dokka-0d0fc1f2bf8f09106e53626bc024298dc91361b8.zip
distinguish ContentBlock (a ContentNode that has children) from leaf nodes
Diffstat (limited to 'test/src/TestAPI.kt')
-rw-r--r--test/src/TestAPI.kt5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/src/TestAPI.kt b/test/src/TestAPI.kt
index b0e23e0f..7db42980 100644
--- a/test/src/TestAPI.kt
+++ b/test/src/TestAPI.kt
@@ -62,7 +62,7 @@ public fun assertEqualsIgnoringSeparators(expectedOutput: String, output: String
Assert.assertEquals(expectedOutput.replace("\r\n", "\n"), output.replace("\r\n", "\n"))
}
-fun StringBuilder.appendChildren(node: ContentNode): StringBuilder {
+fun StringBuilder.appendChildren(node: ContentBlock): StringBuilder {
for (child in node.children) {
val childText = child.toTestString()
append(childText)
@@ -89,9 +89,10 @@ fun StringBuilder.appendNode(node: ContentNode): StringBuilder {
append(node.node.toString())
append("]")
}
- else -> {
+ is ContentBlock -> {
appendChildren(node)
}
+ else -> throw IllegalStateException("Don't know how to format node $node")
}
return this
}