File tree 3 files changed +30
-1
lines changed
3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 1
1
Unreleased Changes
2
2
------------------
3
3
4
+ * Issue - Allow comparison of Numeric types (includes Float).
5
+
4
6
* Issue - Add jmespath.rb to gemspec executables.
5
7
6
8
1.6.1 (2022-03-07)
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ def optimize
28
28
29
29
class ComparatorCondition < Node
30
30
COMPARATOR_TO_CONDITION = { }
31
- COMPARABLE_TYPES = [ Integer , String ] . freeze
31
+ COMPARABLE_TYPES = [ Numeric , String ] . freeze
32
32
33
33
def initialize ( left , right , child )
34
34
@left = left
Original file line number Diff line number Diff line change 465
465
}
466
466
]
467
467
},
468
+ {
469
+ "given" : {"foo" : [{"length" : 170 },
470
+ {"length" : 175.5 },
471
+ {"length" : 185 }]},
472
+ "cases" : [
473
+ {
474
+ "comment" : " Less than number" ,
475
+ "expression" : " foo[?length < `180`]" ,
476
+ "result" : [{"length" : 170 }, {"length" : 175.5 }]
477
+ },
478
+ {
479
+ "comment" : " Less than or equal to number" ,
480
+ "expression" : " foo[?length <= `175.5`]" ,
481
+ "result" : [{"length" : 170 }, {"length" : 175.5 }]
482
+ },
483
+ {
484
+ "comment" : " Greater than number" ,
485
+ "expression" : " foo[?length > `170`]" ,
486
+ "result" : [{"length" : 175.5 }, {"length" : 185 }]
487
+ },
488
+ {
489
+ "comment" : " Greater than or equal to number" ,
490
+ "expression" : " foo[?length >= `175.5`]" ,
491
+ "result" : [{"length" : 175.5 }, {"length" : 185 }]
492
+ }
493
+ ]
494
+ },
468
495
{
469
496
"given" : {
470
497
"foo" : [" 2010-02-01" , " 2011-05-01" ]
You can’t perform that action at this time.
0 commit comments