MCPcopy Create free account
hub / github.com/ReactiveX/RxGo / Test_FromEventSource_Drop

Function Test_FromEventSource_Drop

factory_test.go:334–356  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

332}
333
334func 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) {

Callers

nothing calls this directly

Calls 5

FromEventSourceFunction · 0.85
WithBackPressureStrategyFunction · 0.85
OfFunction · 0.85
AssertFunction · 0.85
CustomPredicateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…