Skip to content

Commit

Permalink
Update test assertions to use IntelliJ "Click to see difference" form…
Browse files Browse the repository at this point in the history
…at (#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
  • Loading branch information
aSemy committed Oct 13, 2022
1 parent cb6bcbb commit dc9983a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ inline fun assertFailsWithSerialMessage(
)
assertTrue(
exception.message!!.contains(message),
"Expected message '${exception.message}' to contain substring '$message'"
"expected:<${exception.message}> but was:<$message>"
)
}
inline fun <reified T : Throwable> assertFailsWithMessage(
Expand All @@ -89,6 +89,6 @@ inline fun <reified T : Throwable> assertFailsWithMessage(
val exception = assertFailsWith(T::class, assertionMessage, block)
assertTrue(
exception.message!!.contains(message),
"Expected message '${exception.message}' to contain substring '$message'"
"expected:<${exception.message}> but was:<$message>"
)
}

0 comments on commit dc9983a

Please sign in to comment.