Skip to content

Commit

Permalink
add quote escape tests for filter expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
gregsdennis committed May 13, 2024
1 parent fadbe5f commit a357af1
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/filter.json
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,30 @@
"selector" : "$[?(@.a || @.b) && @.b]",
"document" : [{"a": 1}],
"result": []
},
{
"name": "string literal, single quote in double quotes",
"selector" : "$[?@ == \"quoted' literal\"]",
"document" : [{"a": 1}],
"result": []
},
{
"name": "string literal, double quote in single quotes",
"selector" : "$[?@ == 'quoted\" literal']",
"document" : [{"a": 1}],
"result": []
},
{
"name": "string literal, escaped single quote in single quotes",
"selector" : "$[?@ == 'quoted\\' literal']",
"document" : [{"a": 1}],
"result": []
},
{
"name": "string literal, escaped double quote in double quotes",
"selector" : "$[?@ == \"quoted\\\" literal\"]",
"document" : [{"a": 1}],
"result": []
}
]
}

0 comments on commit a357af1

Please sign in to comment.