From 7c87f2869b62f0564b916463b33cd9a336be2ecc Mon Sep 17 00:00:00 2001 From: Karlatemp Date: Wed, 30 Mar 2022 15:01:07 +0800 Subject: [PATCH] Fix tests --- .../io/serialization/tars/internal/DebugLoggerTest.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mirai-core/src/commonTest/kotlin/utils/io/serialization/tars/internal/DebugLoggerTest.kt b/mirai-core/src/commonTest/kotlin/utils/io/serialization/tars/internal/DebugLoggerTest.kt index 229965a54..d81e24b3c 100644 --- a/mirai-core/src/commonTest/kotlin/utils/io/serialization/tars/internal/DebugLoggerTest.kt +++ b/mirai-core/src/commonTest/kotlin/utils/io/serialization/tars/internal/DebugLoggerTest.kt @@ -30,6 +30,8 @@ class DebugLoggerTest : AbstractTest() { JCE_DESERIALIZER_DEBUG = true } + fun String.uniteLine(): String = replace("\r\n", "\n").replace("\r", "\n") + @Serializable data class Struct( @TarsId(1) val str: String, @@ -53,7 +55,7 @@ class DebugLoggerTest : AbstractTest() { name=int decodeElementIndex: currentHead == null endStructure: net.mamoe.mirai.internal.utils.io.serialization.tars.internal.DebugLoggerTest.Struct, null, null - """.trimIndent(), out.toByteArray().decodeToString().trim() + """.trimIndent(), out.toByteArray().decodeToString().trim().uniteLine() ) } @@ -75,7 +77,8 @@ class DebugLoggerTest : AbstractTest() { decodeElementIndex: TarsHead(tag=1, type=6(String1)) name=str decodeElementIndex: TarsHead(tag=3, type=0(Byte)) - """.trimIndent(), exception.message!!.trim() + skipping Byte + """.trimIndent().trim(), exception.message!!.trim().uniteLine() ) } } \ No newline at end of file