(t *testing.T)
| 345 | } |
| 346 | |
| 347 | func 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 | |
| 368 | func Test_Observable_Count(t *testing.T) { |
| 369 | defer goleak.VerifyNone(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…