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

Function Test_Observable_BufferWithTime_Multiple

observable_operator_test.go:284–303  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

282}
283
284func Test_Observable_BufferWithTime_Multiple(t *testing.T) {
285 defer goleak.VerifyNone(t)
286 ctx, cancel := context.WithCancel(context.Background())
287 defer cancel()
288 ch := make(chan Item, 1)
289 obs := FromChannel(ch)
290 obs = obs.BufferWithTime(WithDuration(30 * time.Millisecond))
291 go func() {
292 for i := 0; i < 10; i++ {
293 ch <- Of(i)
294 }
295 close(ch)
296 }()
297 Assert(ctx, t, obs, CustomPredicate(func(items []interface{}) error {
298 if len(items) == 0 {
299 return errors.New("items should not be nil")
300 }
301 return nil
302 }))
303}
304
305func Test_Observable_BufferWithTimeOrCount(t *testing.T) {
306 defer goleak.VerifyNone(t)

Callers

nothing calls this directly

Calls 6

FromChannelFunction · 0.85
WithDurationFunction · 0.85
OfFunction · 0.85
AssertFunction · 0.85
CustomPredicateFunction · 0.85
BufferWithTimeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…