Skip to content

Commit

Permalink
Add filter tests for valid non-singular segment
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcono1234 committed Mar 23, 2024
1 parent 7bd8532 commit b4a7db3
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions tests/filter.json
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,45 @@
{"d": "f"}
]
},
{
"name": "non-singluar existence, wildcard",
"selector" : "$[?@.*]",
"document" : [1, [], [2], {}, {"a": 3}],
"result": [
[2],
{"a": 3}
]
},
{
"name": "non-singluar existence, multiple",
"selector" : "$[?@[0, 0, 'a']]",
"document" : [1, [], [2], [2, 3], {"a": 3}, {"a": 3, "b": 4}],
"result": [
[2],
[2, 3],
{"a": 3},
{"a": 3, "b": 4}
]
},
{
"name": "non-singluar existence, slice",
"selector" : "$[?@[0:2]]",
"document" : [1, [], [2], [2, 3, 4], {}, {"a": 3}],
"result": [
[2],
[2, 3, 4]
]
},
{
"name": "non-singluar existence, negated",
"selector" : "$[?!@.*]",
"document" : [1, [], [2], {}, {"a": 3}],
"result": [
1,
[],
{}
]
},
{
"name": "non-singular query in comparison, slice",
"selector" : "$[?@[0:0]==0]",
Expand Down

0 comments on commit b4a7db3

Please sign in to comment.