Emil Kantis
01/11/2025, 12:20 AMdata class Bar(val x: Int)
data class Foo(val bars: List<Bar>)
listOf(
Foo(listOf(Bar(1), Bar(2))),
Foo(listOf(Bar(1), Bar(3))),
).forOne { foo ->
foo.bars.forAll {
it.x shouldBe 1
}
}
Currently fails with the message:
0 elements passed but expected 1
The following elements passed:
--none--
The following elements failed:
[0] Foo(bars=[Bar(x=1), Bar(x=2)]) => 1 elements passed but expected 2
The following elements passed:
[0] Bar(x=1)
The following elements failed:
[1] Bar(x=2) => expected:<1> but was:<2>
[1] Foo(bars=[Bar(x=1), Bar(x=3)]) => 1 elements passed but expected 2
The following elements passed:
[0] Bar(x=1)
The following elements failed:
[1] Bar(x=3) => expected:<1> but was:<3>
Emil Kantis
01/11/2025, 12:20 AM0 elements passed but expected 1
The following elements passed:
--none--
The following elements failed:
[0] Foo(bars=[Bar(x=1), Bar(x=2)]) => 1 elements passed but expected 2
The following elements passed:
[0] Bar(x=1)
The following elements failed:
[1] Bar(x=2) => expected:<1> but was:<2>
[1] Foo(bars=[Bar(x=1), Bar(x=3)]) => 1 elements passed but expected 2
The following elements passed:
[0] Bar(x=1)
The following elements failed:
[1] Bar(x=3) => expected:<1> but was:<3>
Emil Kantis
01/27/2025, 9:14 AM