mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Fix Range#min fast path with exclusive range
This commit is contained in:
@@ -58,7 +58,6 @@ class Range
|
||||
return nil if val == last && exclude_end?
|
||||
|
||||
min = val
|
||||
min -= 1 if exclude_end?
|
||||
return min
|
||||
end
|
||||
|
||||
|
||||
@@ -87,6 +87,7 @@ end
|
||||
assert('Range#min') do
|
||||
# returns the minimum value in the range when called with no arguments
|
||||
assert_equal 1, (1..10).min
|
||||
assert_equal 1, (1...10).min
|
||||
|
||||
# returns the minimum value in the Float range when called with no arguments
|
||||
assert_equal 303.20, (303.20..908.1111).min
|
||||
|
||||
Reference in New Issue
Block a user