File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
lib/puppet/parser/functions Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,11 @@ module Puppet::Parser::Functions
1313 # Sometimes we get numbers as numerics and sometimes as strings.
1414 # We try to compare them as numbers when possible
1515 return args . min do |a , b |
16- a . to_f <=> b . to_f if a . to_s =~ %r{\A ^-?\d +(.\d +)?\z } && b . to_s =~ %r{\A -?\d +(.\d +)?\z }
17- a . to_s <=> b . to_s
16+ if a . to_s =~ %r{\A ^-?\d +(.\d +)?\z } && b . to_s =~ %r{\A -?\d +(.\d +)?\z }
17+ a . to_f <=> b . to_f
18+ else
19+ a . to_s <=> b . to_s
20+ end
1821 end
1922 end
2023end
Original file line number Diff line number Diff line change 77 it { is_expected . to run . with_params ( 1 , 2 ) . and_return ( 1 ) }
88 it { is_expected . to run . with_params ( 1 , 2 , 3 ) . and_return ( 1 ) }
99 it { is_expected . to run . with_params ( 3 , 2 , 1 ) . and_return ( 1 ) }
10+ it { is_expected . to run . with_params ( 12 , 8 ) . and_return ( 8 ) }
1011 it { is_expected . to run . with_params ( 'one' ) . and_return ( 'one' ) }
1112 it { is_expected . to run . with_params ( 'one' , 'two' ) . and_return ( 'one' ) }
1213 it { is_expected . to run . with_params ( 'one' , 'two' , 'three' ) . and_return ( 'one' ) }
You can’t perform that action at this time.
0 commit comments