aboutsummaryrefslogtreecommitdiff
path: root/test/src/TestAPI.kt
diff options
context:
space:
mode:
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
}