mat
12/11/2023, 10:02 PMsam
12/12/2023, 2:29 AMPrint
typeclass could do with an overhaul. PR?mat
12/12/2023, 12:48 PMsam
12/13/2023, 2:00 AMinterface Print
and then look at the implementations, that's what does itmat
12/14/2023, 5:57 PMtest("TestShouldBeEqual") {
"test\n\n" shouldBeEqual "\n"
}
test("TestShouldBe") {
"test\n\n" shouldBe "\n"
}
The test that uses shouldBe
shows a nice error message:
io.kotest.assertions.AssertionFailedError: expected:<"
"> but was:<"test
">
The test that uses shouldBeEqual
shows this worse error message:
java.lang.AssertionError: test
should be equal to
at FakeTest$1$1.invokeSuspend(FakeTest.kt:7)
Note how the nice error is from a kotest assertion, and the ugly one is from a java lang assertion. I believe that this is the cause.mat
12/14/2023, 6:10 PMshouldBe
, the Matcher
system is used to print via the Print
typeclass (Via shouldBe
should
, invokeMatcher
, expected.print()
).
In shouldBeEqual
a MatcherResult is created directly using string interpolation. (eg: "$value should be equal to $expected"
). This, of course, will not call upon the typeclass.
I can make the change in the file, but I cannot figure out how to test these changes. I'll move to the dev channel to ask there and will report back here if I was successful.