Skip to content

Commit ed11790

Browse files
committed
Add compliance tests for non number comparisons
From the spec (http://jmespath.org/specification.html#ordering-operators): > Ordering operators >, >=, <, <= are only valid for numbers. Evaluating > any other type with a comparison operator will yield a null value, ...
1 parent 95ed1f1 commit ed11790

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

tests/compliance/boolean.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@
205205
"given": {
206206
"one": 1,
207207
"two": 2,
208-
"three": 3
208+
"three": 3,
209+
"emptylist": [],
210+
"boolvalue": false
209211
},
210212
"cases": [
211213
{
@@ -236,6 +238,22 @@
236238
"expression": "one != two",
237239
"result": true
238240
},
241+
{
242+
"expression": "emptylist < one",
243+
"result": null
244+
},
245+
{
246+
"expression": "emptylist < nullvalue",
247+
"result": null
248+
},
249+
{
250+
"expression": "emptylist < boolvalue",
251+
"result": null
252+
},
253+
{
254+
"expression": "one < boolvalue",
255+
"result": null
256+
},
239257
{
240258
"expression": "one < two && three > one",
241259
"result": true

0 commit comments

Comments
 (0)