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

Function Test_Observable_GroupBy_Error

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

Source from the content-addressed store, hash-verified

934}
935
936func Test_Observable_GroupBy_Error(t *testing.T) {
937 defer goleak.VerifyNone(t)
938 ctx, cancel := context.WithCancel(context.Background())
939 defer cancel()
940 length := 3
941 count := 11
942
943 obs := Range(0, count).GroupBy(length, func(item Item) int {
944 return 4
945 }, WithBufferedChannel(count))
946 s, err := obs.ToSlice(0)
947 if err != nil {
948 assert.FailNow(t, err.Error())
949 }
950 if len(s) != length {
951 assert.FailNow(t, "length", "got=%d, expected=%d", len(s), length)
952 }
953
954 Assert(ctx, t, s[0].(Observable), HasAnError())
955 Assert(ctx, t, s[1].(Observable), HasAnError())
956 Assert(ctx, t, s[2].(Observable), HasAnError())
957}
958
959func Test_Observable_GroupByDynamic(t *testing.T) {
960 defer goleak.VerifyNone(t)

Callers

nothing calls this directly

Calls 7

RangeFunction · 0.85
WithBufferedChannelFunction · 0.85
AssertFunction · 0.85
HasAnErrorFunction · 0.85
GroupByMethod · 0.65
ToSliceMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…