I tried it out.
It works if the same data class is being compared (e.g.,
MyClass shouldBe MyClass
).
It doesn't work for collections of data classes (e.g.,
listOf(MyClass1, MyClass2) shouldBe listOf(MyClass1, MyClass2)
.
It doesn't work for different data classes (e.g.,
MyClass1
shouldBe
MyClass2
). Obviously, comparing different data classes would always fail the test. However, I believe this is still an issue because Kotest still allows it to compile, and the reader of the test report doesn't know it's a different data class until it's been somewhat formatted.