Hello,
I don't know if it's possible with the actual base Matchers, but it could be usefull to have something like this :
itemIndexOf, itemLastIndexOf
// I don't know if it's the best implementation :
assertThat(["a", "b", "c"], itemIndexOf("b", equalTo(0))) // FALSE
assertThat(["a", "b", "c"], itemIndexOf("b", lessThanOrEqualTo(1))) // TRUE
assertThat(["a", "b", "c"], itemIndexOf("e", equalTo(-1))) // TRUE
Usefull to :
- test position an item in an array ("b" at [1])
- test a position of 2 items in an array ("a" before "b")
Thanks !
Hello,
I don't know if it's possible with the actual base Matchers, but it could be usefull to have something like this :
itemIndexOf, itemLastIndexOf
// I don't know if it's the best implementation :
assertThat(["a", "b", "c"], itemIndexOf("b", equalTo(0))) // FALSE
assertThat(["a", "b", "c"], itemIndexOf("b", lessThanOrEqualTo(1))) // TRUE
assertThat(["a", "b", "c"], itemIndexOf("e", equalTo(-1))) // TRUE
Usefull to :
Thanks !