(ctx context.Context, t *testing.T, left, right []interface{}, window Duration, expected []int64)
| 988 | } |
| 989 | |
| 990 | func 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 | |
| 1018 | func Test_Observable_Join1(t *testing.T) { |
| 1019 | defer goleak.VerifyNone(t) |
no test coverage detected
searching dependent graphs…