diff --git a/rule/json_test.go b/rule/json_test.go index 43e170d..6e111dd 100644 --- a/rule/json_test.go +++ b/rule/json_test.go @@ -54,6 +54,10 @@ func TestUnmarshalExpr(t *testing.T) { {"not", []byte(`{"kind":"not","operands": [{"kind": "value"}, {"kind": "param"}]}`), new(exprNot)}, {"and", []byte(`{"kind":"and","operands": [{"kind": "value"}, {"kind": "param"}]}`), new(exprAnd)}, {"or", []byte(`{"kind":"or","operands": [{"kind": "value"}, {"kind": "param"}]}`), new(exprOr)}, + {"gt", []byte(`{"kind":"gt","operands": [{"kind": "value"}, {"kind": "param"}]}`), new(exprGT)}, + {"gte", []byte(`{"kind":"gte","operands": [{"kind": "value"}, {"kind": "param"}]}`), new(exprGTE)}, + {"lt", []byte(`{"kind":"lt","operands": [{"kind": "value"}, {"kind": "param"}]}`), new(exprLT)}, + {"lte", []byte(`{"kind":"lte","operands": [{"kind": "value"}, {"kind": "param"}]}`), new(exprLTE)}, {"param", []byte(`{"kind":"param"}`), new(Param)}, {"value", []byte(`{"kind":"value"}`), new(Value)}, } @@ -131,6 +135,22 @@ func TestRuleUnmarshalling(t *testing.T) { Not( BoolValue(true), ), + GT( + Int64Value(11), + Int64Value(10), + ), + GTE( + Int64Value(11), + Int64Value(11), + ), + LT( + Int64Value(10), + Int64Value(11), + ), + LTE( + Int64Value(10), + Int64Value(10), + ), ), True(), ),