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

Function Test_Observable_Contain_Parallel

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

Source from the content-addressed store, hash-verified

345}
346
347func Test_Observable_Contain_Parallel(t *testing.T) {
348 defer goleak.VerifyNone(t)
349 ctx, cancel := context.WithCancel(context.Background())
350 defer cancel()
351 predicate := func(i interface{}) bool {
352 switch i := i.(type) {
353 case int:
354 return i == 2
355 default:
356 return false
357 }
358 }
359
360 Assert(ctx, t,
361 testObservable(ctx, 1, 2, 3).Contains(predicate, WithContext(ctx), WithCPUPool()),
362 HasItem(true))
363 Assert(ctx, t,
364 testObservable(ctx, 1, 5, 3).Contains(predicate, WithContext(ctx), WithCPUPool()),
365 HasItem(false))
366}
367
368func Test_Observable_Count(t *testing.T) {
369 defer goleak.VerifyNone(t)

Callers

nothing calls this directly

Calls 6

AssertFunction · 0.85
testObservableFunction · 0.85
WithContextFunction · 0.85
WithCPUPoolFunction · 0.85
HasItemFunction · 0.85
ContainsMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…