(t *testing.T, f checkF, compare func(x any) assert.BoolOrComparison)
| 366 | ) |
| 367 | |
| 368 | func pollCheck(t *testing.T, f checkF, compare func(x any) assert.BoolOrComparison) poll.Check { |
| 369 | return func(poll.LogT) poll.Result { |
| 370 | t.Helper() |
| 371 | v, comment := f(t) |
| 372 | r := compare(v) |
| 373 | switch r := r.(type) { |
| 374 | case bool: |
| 375 | if r { |
| 376 | return poll.Success() |
| 377 | } |
| 378 | case is.Comparison: |
| 379 | if r().Success() { |
| 380 | return poll.Success() |
| 381 | } |
| 382 | default: |
| 383 | panic(fmt.Errorf("pollCheck: type %T not implemented", r)) |
| 384 | } |
| 385 | return poll.Continue("%v", comment) |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | func reducedCheck(r reducer, funcs ...checkF) checkF { |
| 390 | return func(t *testing.T) (any, string) { |
no test coverage detected
searching dependent graphs…