(t *testing.T)
| 1607 | } |
| 1608 | |
| 1609 | func Test_Observable_Retry(t *testing.T) { |
| 1610 | defer goleak.VerifyNone(t) |
| 1611 | ctx, cancel := context.WithCancel(context.Background()) |
| 1612 | defer cancel() |
| 1613 | i := 0 |
| 1614 | obs := Defer([]Producer{func(ctx context.Context, next chan<- Item) { |
| 1615 | next <- Of(1) |
| 1616 | next <- Of(2) |
| 1617 | if i == 2 { |
| 1618 | next <- Of(3) |
| 1619 | } else { |
| 1620 | i++ |
| 1621 | next <- Error(errFoo) |
| 1622 | } |
| 1623 | }}).Retry(3, func(err error) bool { |
| 1624 | return true |
| 1625 | }) |
| 1626 | Assert(ctx, t, obs, HasItems(1, 2, 1, 2, 1, 2, 3), HasNoError()) |
| 1627 | } |
| 1628 | |
| 1629 | func Test_Observable_Retry_Error_ShouldRetry(t *testing.T) { |
| 1630 | defer goleak.VerifyNone(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…