strikt icon indicating copy to clipboard operation
strikt copied to clipboard

Missing clue when comparing multiline strings

Open nenick opened this issue 5 years ago • 0 comments

There is no useful clue when one line ends with an additional whitespace.

The test expectThat("\ntest \n").isEqualTo("\ntest\n") results in:

org.opentest4j.AssertionFailedError: ▼ Expect that "
|test
|":
✗ is equal to "
|test
|"
found "
|test
|"

Also the additional whitespace was eliminated on the console output which makes it more difficult to find the problem. It would be helpful to enhance the report like other tools do:

org.opentest4j.AssertionFailedError: expected:<"
test[]
"> but was:<"
test[ ]
">

Version: io.strikt:strikt-core:0.26.1

nenick avatar Jul 19 '20 22:07 nenick