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

Function joinTest

observable_operator_test.go:990–1016  ·  view source on GitHub ↗
(ctx context.Context, t *testing.T, left, right []interface{}, window Duration, expected []int64)

Source from the content-addressed store, hash-verified

988}
989
990func joinTest(ctx context.Context, t *testing.T, left, right []interface{}, window Duration, expected []int64) {
991 leftObs := testObservable(ctx, left...)
992 rightObs := testObservable(ctx, right...)
993
994 obs := leftObs.Join(func(ctx context.Context, l, r interface{}) (interface{}, error) {
995 return map[string]interface{}{
996 "l": l,
997 "r": r,
998 }, nil
999 },
1000 rightObs,
1001 func(i interface{}) time.Time {
1002 return time.Unix(0, i.(map[string]int64)["tt"]*1000000)
1003 },
1004 window,
1005 )
1006
1007 Assert(ctx, t, obs, CustomPredicate(func(items []interface{}) error {
1008 actuals := make([]int64, 0)
1009 for _, p := range items {
1010 val := p.(map[string]interface{})
1011 actuals = append(actuals, val["l"].(map[string]int64)["V"], val["r"].(map[string]int64)["V"])
1012 }
1013 assert.Equal(t, expected, actuals)
1014 return nil
1015 }))
1016}
1017
1018func Test_Observable_Join1(t *testing.T) {
1019 defer goleak.VerifyNone(t)

Callers 5

Test_Observable_Join1Function · 0.85
Test_Observable_Join2Function · 0.85
Test_Observable_Join3Function · 0.85

Calls 4

testObservableFunction · 0.85
AssertFunction · 0.85
CustomPredicateFunction · 0.85
JoinMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…