(t *testing.T)
| 332 | } |
| 333 | |
| 334 | func Test_FromEventSource_Drop(t *testing.T) { |
| 335 | defer goleak.VerifyNone(t) |
| 336 | const max = 100000 |
| 337 | next := make(chan Item, max) |
| 338 | obs := FromEventSource(next, WithBackPressureStrategy(Drop)) |
| 339 | |
| 340 | go func() { |
| 341 | for i := 0; i < max; i++ { |
| 342 | next <- Of(i) |
| 343 | } |
| 344 | close(next) |
| 345 | }() |
| 346 | |
| 347 | Assert(context.Background(), t, obs, CustomPredicate(func(items []interface{}) error { |
| 348 | if len(items) == max { |
| 349 | return errors.New("some items should be dropped") |
| 350 | } |
| 351 | if len(items) == 0 { |
| 352 | return errors.New("no items") |
| 353 | } |
| 354 | return nil |
| 355 | })) |
| 356 | } |
| 357 | |
| 358 | // FIXME |
| 359 | //func Test_Interval(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…