(t *testing.T)
| 843 | } |
| 844 | |
| 845 | func TestProcessBinaryBoolean(t *testing.T) { |
| 846 | tests := []struct { |
| 847 | in *mathTree |
| 848 | out types.Val |
| 849 | }{ |
| 850 | {in: &mathTree{ |
| 851 | Fn: "<", |
| 852 | Child: []*mathTree{ |
| 853 | {Val: createShardedMap(0, types.Val{Tid: types.IntID, Value: int64(1)})}, |
| 854 | {Const: types.Val{Tid: types.IntID, Value: int64(2)}}, |
| 855 | }}, |
| 856 | out: types.Val{Tid: types.BoolID, Value: true}, |
| 857 | }, |
| 858 | {in: &mathTree{ |
| 859 | Fn: ">", |
| 860 | Child: []*mathTree{ |
| 861 | {Val: createShardedMap(0, types.Val{Tid: types.IntID, Value: int64(1)})}, |
| 862 | {Const: types.Val{Tid: types.IntID, Value: int64(2)}}, |
| 863 | }}, |
| 864 | out: types.Val{Tid: types.BoolID, Value: false}, |
| 865 | }, |
| 866 | {in: &mathTree{ |
| 867 | Fn: "<=", |
| 868 | Child: []*mathTree{ |
| 869 | {Val: createShardedMap(0, types.Val{Tid: types.IntID, Value: int64(1)})}, |
| 870 | {Const: types.Val{Tid: types.IntID, Value: int64(2)}}, |
| 871 | }}, |
| 872 | out: types.Val{Tid: types.BoolID, Value: true}, |
| 873 | }, |
| 874 | {in: &mathTree{ |
| 875 | Fn: ">=", |
| 876 | Child: []*mathTree{ |
| 877 | {Val: createShardedMap(0, types.Val{Tid: types.IntID, Value: int64(1)})}, |
| 878 | {Const: types.Val{Tid: types.IntID, Value: int64(2)}}, |
| 879 | }}, |
| 880 | out: types.Val{Tid: types.BoolID, Value: false}, |
| 881 | }, |
| 882 | {in: &mathTree{ |
| 883 | Fn: "==", |
| 884 | Child: []*mathTree{ |
| 885 | {Val: createShardedMap(0, types.Val{Tid: types.IntID, Value: int64(1)})}, |
| 886 | {Const: types.Val{Tid: types.IntID, Value: int64(2)}}, |
| 887 | }}, |
| 888 | out: types.Val{Tid: types.BoolID, Value: false}, |
| 889 | }, |
| 890 | {in: &mathTree{ |
| 891 | Fn: "!=", |
| 892 | Child: []*mathTree{ |
| 893 | {Val: createShardedMap(0, types.Val{Tid: types.IntID, Value: int64(1)})}, |
| 894 | {Const: types.Val{Tid: types.IntID, Value: int64(2)}}, |
| 895 | }}, |
| 896 | out: types.Val{Tid: types.BoolID, Value: true}, |
| 897 | }, |
| 898 | } |
| 899 | for _, tc := range tests { |
| 900 | t.Logf("Test %s", tc.in.Fn) |
| 901 | require.NoError(t, processBinaryBoolean(tc.in)) |
| 902 | val, ok := tc.in.Val.Get(0) |
nothing calls this directly
no test coverage detected
searching dependent graphs…