Question. How does one get a kproperty for a nested property? I'm trying to do something like the following with kotest assertions:
Copy code
data class Foo(val id: Int, val description: String)
data class Bar(val foo: Foo)
val firstFoo = Foo(1, "Bar!")
val secondFoo = Foo(2, "Bar!")
firstFoo.shouldBeEqualToIgnoringFields(secondFoo, Foo::id) // Assertion passes
val firstBar = Bar(firstFoo)
val secondBar = Bar(secondFoo)
firstBar.shouldBeEqualToIgnoringFields(secondBar, Bar::Foo::id) // Does not compile due to unresolved reference :(
d
Daniel Pitts
07/03/2024, 6:35 PM
There really isn't a way. You would have to ignore the