I'm not really sure how we propose to do this inst...
# kotest-contributors
e
I'm not really sure how we propose to do this instead? https://github.com/kotest/kotest/issues/3492 Shouldn't we change
shouldBeEqualToComparingFields
to handle standard collections?
E.g.: For List/Array: Considered equal if lengths are equal and each position contains an item which matches expected by comparing fields For Set: Considered equal if sizes are equal and each item in actual has an item which matches in expected by comparing fields For Map: considered equal if each entry in actual has a match in expected by comparing fields of
key
and
value
s
forAll ?
e
Doesn't work if I want to check
Copy code
class A(val b: B)
class B(val c: C)
class C(val ds: List<D>)
class D(val something: String, val other: Int)
and want to check that
a1
and
a2
are equal?
s
list.forAll { it.equal comaring fields ? }
e
but the list is on the inner-most level
Copy code
a1.b.c.d.forAll { it shouldEqualComparingfields a2.b.c.d }
(and then if there's other properties on other levels we have to check them by hand)