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

Function Test_Observable_FlatMap_Error1

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

Source from the content-addressed store, hash-verified

774}
775
776func Test_Observable_FlatMap_Error1(t *testing.T) {
777 defer goleak.VerifyNone(t)
778 ctx, cancel := context.WithCancel(context.Background())
779 defer cancel()
780 obs := testObservable(ctx, 1, 2, 3).FlatMap(func(i Item) Observable {
781 if i.V == 2 {
782 return testObservable(ctx, errFoo)
783 }
784 return testObservable(ctx, i.V.(int)+1, i.V.(int)*10)
785 })
786 Assert(ctx, t, obs, HasItems(2, 10), HasError(errFoo))
787}
788
789func Test_Observable_FlatMap_Error2(t *testing.T) {
790 defer goleak.VerifyNone(t)

Callers

nothing calls this directly

Calls 5

testObservableFunction · 0.85
AssertFunction · 0.85
HasItemsFunction · 0.85
HasErrorFunction · 0.85
FlatMapMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…