diff --git a/tests/filter.json b/tests/filter.json index 03b8b67..5d0eed5 100644 --- a/tests/filter.json +++ b/tests/filter.json @@ -897,42 +897,46 @@ }, { "name": "and binds more tightly than or", - "selector" : "$[?@.a || @.b && @.b]", - "document" : [{"a": 1}], + "selector" : "$[?@.a || @.b && @.c]", + "document" : [{"a": 1}, {"b": 2, "c": 3}, {"c": 3}, {"b": 2}, {"a": 1, "b": 2, "c": 3}], "result": [ - {"a": 1} + {"a": 1}, + {"b": 2, "c": 3}, + {"a": 1, "b": 2, "c": 3} ] }, { "name": "left to right evaluation", - "selector" : "$[?@.b && @.b || @.a]", - "document" : [{"a": 1}], + "selector" : "$[?@.a && @.b || @.c]", + "document" : [{"a": 1}, {"b": 2}, {"a": 1, "b": 2}, {"a": 1, "c": 3}, {"b": 1, "c": 3}, {"c": 3}, {"a": 1, "b": 2, "c": 3}], "result": [ - {"a": 1} + {"a": 1, "b": 2}, + {"a": 1, "c": 3}, + {"b": 1, "c": 3}, + {"c": 3}, + {"a": 1, "b": 2, "c": 3} ] }, { "name": "group terms, left", - "selector" : "$[?(@.a || @.b) && @.a]", - "document" : [{"a": 1}], + "selector" : "$[?(@.a || @.b) && @.c]", + "document" : [{"a": 1, "b": 2}, {"a": 1, "c": 3}, {"b": 2, "c": 3}, {"a": 1}, {"b": 2}, {"c": 3}, {"a": 1, "b": 2, "c": 3}], "result": [ - {"a": 1} + {"a": 1, "c": 3}, + {"b": 2, "c": 3}, + {"a": 1, "b": 2, "c": 3} ] }, { "name": "group terms, right", - "selector" : "$[?@.a && (@.b || @.a)]", - "document" : [{"a": 1}], + "selector" : "$[?@.a && (@.b || @.c)]", + "document" : [{"a": 1}, {"a": 1, "b": 2}, {"a": 1, "c": 2}, {"b": 2}, {"c": 2}, {"a": 1, "b": 2, "c": 3}], "result": [ - {"a": 1} + {"a": 1, "b": 2}, + {"a": 1, "c": 2}, + {"a": 1, "b": 2, "c": 3} ] }, - { - "name": "group terms, or before and", - "selector" : "$[?(@.a || @.b) && @.b]", - "document" : [{"a": 1}], - "result": [] - }, { "name": "string literal, single quote in double quotes", "selector" : "$[?@ == \"quoted' literal\"]",