aboutsummaryrefslogtreecommitdiff
path: root/test/src
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-01-22 11:30:57 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-01-22 11:30:57 +0100
commit599f32d9bf64fc81dc60e54d5dc5f639086df786 (patch)
tree69ade26243e9ddecbeaa64af2a8e3f4c6060a52d /test/src
parentdb6f8c09977be52109fc65f810ad030fe13bc3e1 (diff)
downloaddokka-599f32d9bf64fc81dc60e54d5dc5f639086df786.tar.gz
dokka-599f32d9bf64fc81dc60e54d5dc5f639086df786.tar.bz2
dokka-599f32d9bf64fc81dc60e54d5dc5f639086df786.zip
fix comment test on Windows agents
Diffstat (limited to 'test/src')
-rw-r--r--test/src/TestAPI.kt8
-rw-r--r--test/src/model/CommentTest.kt2
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)
}