Skip to content

Commit

Permalink
testing helper
Browse files Browse the repository at this point in the history
  • Loading branch information
adamluzsi committed Sep 22, 2024
1 parent 21a0594 commit 502c6e3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion assert/AnyOf.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,15 @@ func (ao *A) OK() bool {
func OneOf[T any](tb testing.TB, vs []T, blk func(t It, got T), msg ...Message) {
tb.Helper()
Must(tb).AnyOf(func(a *A) {
tb.Helper()
a.name = "OneOf"
a.cause = "None of the element matched the expectations"
for _, v := range vs {
a.Case(func(it It) { blk(it, v) })
a.Case(func(it It) {
tb.Helper()

blk(it, v)
})
if a.OK() {
break
}
Expand Down

0 comments on commit 502c6e3

Please sign in to comment.