Skip to content

Commit

Permalink
Exist in order draft (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexCue987 committed Feb 16, 2024
1 parent 7bf1202 commit 4fe9f88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fun <T> existInOrder(predicates: List<(T) -> Boolean>): Matcher<Collection<T>?>

MatcherResult(
subsequenceIndex == predicates.size,
{ "${actual.print().value} did not match the predicates ${predicates.print().value} in order. Predicate number $subsequenceIndex did not match." },
{ "${actual.print().value} did not match the predicates ${predicates.print().value} in order. Predicate at index $subsequenceIndex did not match." },
{ "${actual.print().value} should not match the predicates ${predicates.print().value} in order" }
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ShouldExistInOrderTest: WordSpec() {
"pass" {
listOf(1, 2).shouldExistInOrder(
{ i: Int -> i < 2 },
{ i: Int -> i < 3 }
{ i: Int -> i < 3 }
)
}
"fail with clear message" {
Expand All @@ -20,7 +20,7 @@ class ShouldExistInOrderTest: WordSpec() {
{ i: Int -> i < 2 },
{ i: Int -> i < 2 }
)
}.message shouldBe "[1, 2] did not match the predicates [(kotlin.Int) -> kotlin.Boolean, (kotlin.Int) -> kotlin.Boolean] in order. Predicate number 1 did not match."
}.message shouldBe "[1, 2] did not match the predicates [(kotlin.Int) -> kotlin.Boolean, (kotlin.Int) -> kotlin.Boolean] in order. Predicate at index 1 did not match."
}
}
}
Expand Down

0 comments on commit 4fe9f88

Please sign in to comment.