Fix comparison of post and reply texts
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 13 Jan 2017 18:10:48 +0000 (19:10 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 13 Jan 2017 18:10:48 +0000 (19:10 +0100)
src/test/kotlin/net/pterodactylus/sone/fcp/SoneCommandTest.kt

index 3bdcb4a..e6ba1ea 100644 (file)
@@ -107,14 +107,14 @@ abstract class SoneCommandTest {
                expect("Sone", post.sone.id) { it["Sone"] }
                expect("recipient", post.recipientId.orNull()) { it["Recipient"] }
                expect("time", post.time.toString()) { it["Time"] }
-               expect("text", post.text) { it["Text"] }
+               expect("text", post.text.replace("\\", "\\\\").replace("\r", "\\r").replace("\n", "\\n")) { it["Text"] }
        }
 
        protected fun matchesReply(reply: PostReply) = OneByOneMatcher<Map<String, String?>>().apply {
                expect("ID", reply.id) { it["ID"] }
                expect("Sone", reply.sone.id) { it["Sone"] }
                expect("time", reply.time.toString()) { it["Time"] }
-               expect("text", reply.text) { it["Text"] }
+               expect("text", reply.text.replace("\\", "\\\\").replace("\r", "\\r").replace("\n", "\\n")) { it["Text"] }
        }
 
 }