File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed
Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 11Unreleased Changes
22------------------
33
4+ * Issue - Allow comparison of Numeric types (includes Float).
5+
46* Issue - Add jmespath.rb to gemspec executables.
57
681.6.1 (2022-03-07)
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ def optimize
2828
2929 class ComparatorCondition < Node
3030 COMPARATOR_TO_CONDITION = { }
31- COMPARABLE_TYPES = [ Integer , String ] . freeze
31+ COMPARABLE_TYPES = [ Numeric , String ] . freeze
3232
3333 def initialize ( left , right , child )
3434 @left = left
Original file line number Diff line number Diff line change 465465 }
466466 ]
467467 },
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+ },
468495 {
469496 "given" : {
470497 "foo" : [" 2010-02-01" , " 2011-05-01" ]
You can’t perform that action at this time.
0 commit comments