diff options
Diffstat (limited to 'test/src')
-rw-r--r-- | test/src/TestAPI.kt | 8 | ||||
-rw-r--r-- | test/src/model/CommentTest.kt | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/test/src/TestAPI.kt b/test/src/TestAPI.kt index efebfeca..2cdaad5d 100644 --- a/test/src/TestAPI.kt +++ b/test/src/TestAPI.kt @@ -53,11 +53,15 @@ public fun verifyOutput(path: String, outputExtension: String, outputGenerator: verifyModel(path) { val output = StringBuilder() outputGenerator(it, output) - val expectedOutput = File(path.replace(".kt", outputExtension)).readText().replace("\r\n", "\n") - Assert.assertEquals(expectedOutput, output.toString().replace("\r\n", "\n")) + val expectedOutput = File(path.replace(".kt", outputExtension)).readText() + assertEqualsIgnoringSeparators(expectedOutput, output.toString()) } } +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 { for (child in node.children) { val childText = child.toTestString() diff --git a/test/src/model/CommentTest.kt b/test/src/model/CommentTest.kt index 63a957e7..828deaa4 100644 --- a/test/src/model/CommentTest.kt +++ b/test/src/model/CommentTest.kt @@ -149,7 +149,7 @@ line two""", toTestString()) assertEquals("Summary", content.summary.toTestString()) assertEquals(2, content.sections.count()) with (content.description) { - assertEquals("""[code] + assertEqualsIgnoringSeparators("""[code] if (true) { println(property) } |