-
Notifications
You must be signed in to change notification settings - Fork 682
Closed
Labels
bug 🐛Issues that report a problem or error in the code.Issues that report a problem or error in the code.
Description
Which version of Kotest are you using
Using Kotest 5.8.0.
containExactly
and containExactlyInAnyOrder
takes a verifier parameter, but doesn't respect it in the matching logic. For example, the first two of these tests fail when they should pass:
class ContainIgnoringFieldsTest {
data class Foo(val a: Int, val b: String)
@Test
fun testAnyOrder() {
listOf(Foo(1, "a"), Foo(2, "b")) should
containExactlyInAnyOrder(
listOf(Foo(3, "a"), Foo(4, "b")), Equality.byReflectionIgnoringFields(Foo::a))
}
@Test
fun test() {
listOf(Foo(1, "a"), Foo(2, "b")) should
containExactly(
listOf(Foo(3, "a"), Foo(4, "b")), Equality.byReflectionIgnoringFields(Foo::a))
}
@Test
fun testAll() {
listOf(Foo(1, "a"), Foo(2, "b")) should
containAll(listOf(Foo(3, "a"), Foo(4, "b")), Equality.byReflectionIgnoringFields(Foo::a))
}
}
Metadata
Metadata
Assignees
Labels
bug 🐛Issues that report a problem or error in the code.Issues that report a problem or error in the code.