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

Function Test_Connectable_IterableChannel_Disposed

factory_connectable_test.go:46–64  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

44}
45
46func Test_Connectable_IterableChannel_Disposed(t *testing.T) {
47 defer goleak.VerifyNone(t)
48 ch := make(chan Item, 10)
49 go func() {
50 ch <- Of(1)
51 ch <- Of(2)
52 ch <- Of(3)
53 close(ch)
54 }()
55 obs := &ObservableImpl{
56 iterable: newChannelIterable(ch, WithPublishStrategy()),
57 }
58 ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond)
59 defer cancel()
60 _, disposable := obs.Connect(ctx)
61 disposable()
62 time.Sleep(50 * time.Millisecond)
63 Assert(ctx, t, obs, IsEmpty())
64}
65
66func Test_Connectable_IterableChannel_WithoutConnect(t *testing.T) {
67 defer goleak.VerifyNone(t)

Callers

nothing calls this directly

Calls 6

ConnectMethod · 0.95
OfFunction · 0.85
newChannelIterableFunction · 0.85
WithPublishStrategyFunction · 0.85
AssertFunction · 0.85
IsEmptyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…