Skip to content

Commit dc9983a

Browse files
authored
Update test assertions to use IntelliJ "Click to see difference" format (#2062)
This makes test failures easier to see, because when the test fails IntelliJ will generate a 'click to see difference' link that opens the IntelliJ comparison editor, with the two strings provided. https://stackoverflow.com/q/10934743/4161471
1 parent cb6bcbb commit dc9983a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

formats/json-tests/commonTest/src/kotlinx/serialization/test/TestingFramework.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ inline fun assertFailsWithSerialMessage(
7878
)
7979
assertTrue(
8080
exception.message!!.contains(message),
81-
"Expected message '${exception.message}' to contain substring '$message'"
81+
"expected:<${exception.message}> but was:<$message>"
8282
)
8383
}
8484
inline fun <reified T : Throwable> assertFailsWithMessage(
@@ -89,6 +89,6 @@ inline fun <reified T : Throwable> assertFailsWithMessage(
8989
val exception = assertFailsWith(T::class, assertionMessage, block)
9090
assertTrue(
9191
exception.message!!.contains(message),
92-
"Expected message '${exception.message}' to contain substring '$message'"
92+
"expected:<${exception.message}> but was:<$message>"
9393
)
9494
}

0 commit comments

Comments
 (0)