|
841 | 841 | userData = map[string]interface{}{ |
842 | 842 | "achievements": 4, |
843 | 843 | "achievements2": 2, |
| 844 | + "int": 93, |
| 845 | + "int2": 0, |
844 | 846 | } |
845 | 847 | udMarsh, _ = json.Marshal(userData) |
846 | 848 | match, err = m.Match(udMarsh) |
|
853 | 855 | assert.Nil(err) |
854 | 856 | matchDef = trans.Transform([]Expression{expr}) |
855 | 857 | assert.NotNil(matchDef) |
| 858 | + m = NewFastMatcher(matchDef) |
856 | 859 | match, err = m.Match(udMarsh) |
857 | 860 | assert.True(match) |
858 | 861 |
|
|
863 | 866 | assert.Nil(err) |
864 | 867 | matchDef = trans.Transform([]Expression{expr}) |
865 | 868 | assert.NotNil(matchDef) |
| 869 | + m = NewFastMatcher(matchDef) |
866 | 870 | match, err = m.Match(udMarsh) |
867 | 871 | assert.True(match) |
868 | 872 |
|
|
873 | 877 | assert.Nil(err) |
874 | 878 | matchDef = trans.Transform([]Expression{expr}) |
875 | 879 | assert.NotNil(matchDef) |
| 880 | + m = NewFastMatcher(matchDef) |
876 | 881 | match, err = m.Match(udMarsh) |
877 | 882 | assert.True(match) |
878 | 883 |
|
|
883 | 888 | assert.Nil(err) |
884 | 889 | matchDef = trans.Transform([]Expression{expr}) |
885 | 890 | assert.NotNil(matchDef) |
| 891 | + m = NewFastMatcher(matchDef) |
| 892 | + match, err = m.Match(udMarsh) |
| 893 | + assert.True(match) |
| 894 | + |
| 895 | + fe = &FilterExpression{} |
| 896 | + err = parser.ParseString("ASIN(int)<>3.05682983181e+307 AND ASIN(int) != ASIN(int) AND NOT ASIN(int) > ASIN(int) AND NOT ASIN(int) <= ASIN(int)", fe) |
| 897 | + assert.Nil(err) |
| 898 | + expr, err = fe.OutputExpression() |
| 899 | + assert.Nil(err) |
| 900 | + matchDef = trans.Transform([]Expression{expr}) |
| 901 | + m = NewFastMatcher(matchDef) |
| 902 | + assert.NotNil(matchDef) |
| 903 | + match, err = m.Match(udMarsh) |
| 904 | + assert.True(match) |
| 905 | + |
| 906 | + fe = &FilterExpression{} |
| 907 | + err = parser.ParseString("ATAN(int)<>3.05682983181e+307", fe) |
| 908 | + assert.Nil(err) |
| 909 | + expr, err = fe.OutputExpression() |
| 910 | + assert.Nil(err) |
| 911 | + matchDef = trans.Transform([]Expression{expr}) |
| 912 | + m = NewFastMatcher(matchDef) |
| 913 | + assert.NotNil(matchDef) |
| 914 | + match, err = m.Match(udMarsh) |
| 915 | + assert.True(match) |
| 916 | + |
| 917 | + fe = &FilterExpression{} |
| 918 | + err = parser.ParseString("ASIN(int2)<>3.05682983181e+307", fe) |
| 919 | + assert.Nil(err) |
| 920 | + expr, err = fe.OutputExpression() |
| 921 | + assert.Nil(err) |
| 922 | + matchDef = trans.Transform([]Expression{expr}) |
| 923 | + m = NewFastMatcher(matchDef) |
| 924 | + assert.NotNil(matchDef) |
| 925 | + match, err = m.Match(udMarsh) |
| 926 | + assert.True(match) |
| 927 | + |
| 928 | + fe = &FilterExpression{} |
| 929 | + err = parser.ParseString("ATAN(int2)<>3.05682983181e+307", fe) |
| 930 | + assert.Nil(err) |
| 931 | + expr, err = fe.OutputExpression() |
| 932 | + assert.Nil(err) |
| 933 | + matchDef = trans.Transform([]Expression{expr}) |
| 934 | + m = NewFastMatcher(matchDef) |
| 935 | + assert.NotNil(matchDef) |
886 | 936 | match, err = m.Match(udMarsh) |
887 | 937 | assert.True(match) |
888 | 938 |
|
|
902 | 952 | "achievements": [6]int{49, 58, 108, 141, 177, 229}, |
903 | 953 | } |
904 | 954 | udMarsh, _ = json.Marshal(userData) |
| 955 | + m = NewFastMatcher(matchDef) |
905 | 956 | match, err = m.Match(udMarsh) |
906 | 957 | assert.True(match) |
907 | 958 |
|
|
929 | 980 | assert.NotNil(matchDef) |
930 | 981 | udMarsh, _ = json.Marshal(beer) |
931 | 982 | match, err = m.Match(udMarsh) |
| 983 | + m = NewFastMatcher(matchDef) |
932 | 984 | assert.True(match) |
933 | 985 |
|
934 | 986 | fe = &FilterExpression{} |
|
944 | 996 | assert.Nil(err) |
945 | 997 | matchDef = trans.Transform([]Expression{expr}) |
946 | 998 | assert.NotNil(matchDef) |
| 999 | + m = NewFastMatcher(matchDef) |
947 | 1000 | match, err = m.Match(marshalledData) |
948 | 1001 | assert.True(match) |
949 | 1002 |
|
|
0 commit comments