You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importorg.assertj.core.api.Assertionsimportorg.junit.jupiter.api.Testimportstrikt.api.expectThatimportstrikt.assertions.containsinternalclassMk {
companionobject {
privatevalS=""" first line second line third line""".trimIndent()
}
@Test
internalfun`assertj contains`() {
Assertions.assertThat(S)
.contains("fourth line")
}
@Test
internalfun`strikt contains`() {
expectThat(S)
.contains("fourth line")
}
}
AssertJ output
Expecting:
java.lang.AssertionError:
Expecting:
<"first line
second line
third line">
to contain:
<"fourth line">
Strikt output
org.opentest4j.AssertionFailedError: ▼ Expect that "first line second line third line":
✗ contains "fourth line" : found "first line second line third line"
I find the AssertJ a bit more readable in that he multi line text is formatted that way in the assertion error output.
Also, in the strikt output the "first line second line third line" piece is duplicated when it might not have to be.
Maybe:
Improve subject line to have improved formatting for multi line string contexts
Reduce duplication of subject in assertions messages
WDYT?
The text was updated successfully, but these errors were encountered:
Example:
AssertJ output
Strikt output
I find the AssertJ a bit more readable in that he multi line text is formatted that way in the assertion error output.
Also, in the
strikt
output the"first line second line third line"
piece is duplicated when it might not have to be.Maybe:
WDYT?
The text was updated successfully, but these errors were encountered: