how would i assert that in a list one element come...
# strikt
c
how would i assert that in a list one element comes before the other?
Copy code
expectThat(listOf(A,B,C)) {
  get {indexOf(A)}.isLowerThan(….)
}
Copy code
expectThat(listOf(A,B,C)).positionOf(A).isBefore(B)
Copy code
expectThat(listOf(A,B,C)).contains(A).before(B)
also nice but there is already a contains matcher
a workaround is expectThat(listOf(A,B,C)).get { intersect(B,C) }.containsExactly(B,C)
r
Yeah, it feels like we could do something here. It's effectively a sorting assertion over a sub-list. I'll give some thought to how we could best express that.
c