diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2015-02-10 18:32:12 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2015-02-10 18:32:12 +0100 |
commit | 0d0fc1f2bf8f09106e53626bc024298dc91361b8 (patch) | |
tree | 7364f5a98dacdad3524389c0d818b32ab2641009 /test/src/TestAPI.kt | |
parent | 92075236fb1356fe6023edff1e43fe3125b76c18 (diff) | |
download | dokka-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.kt | 5 |
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 } |