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

Function Test_Observable_Take_Interval

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

Source from the content-addressed store, hash-verified

2038}
2039
2040func Test_Observable_Take_Interval(t *testing.T) {
2041 defer goleak.VerifyNone(t)
2042 ctx, cancel := context.WithCancel(context.Background())
2043 defer cancel()
2044 obs := Interval(WithDuration(time.Nanosecond), WithContext(ctx)).Take(3)
2045 Assert(ctx, t, obs, CustomPredicate(func(items []interface{}) error {
2046 if len(items) != 3 {
2047 return errors.New("3 items are expected")
2048 }
2049 return nil
2050 }))
2051}
2052
2053func Test_Observable_TakeLast(t *testing.T) {
2054 defer goleak.VerifyNone(t)

Callers

nothing calls this directly

Calls 6

IntervalFunction · 0.85
WithDurationFunction · 0.85
WithContextFunction · 0.85
AssertFunction · 0.85
CustomPredicateFunction · 0.85
TakeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…