mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* range.c (range_max): fix behavior with excluded end value.
[Bug #4591] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b1d647c809
commit
d22e08f937
3 changed files with 10 additions and 0 deletions
|
@ -68,6 +68,8 @@ class TestRange < Test::Unit::TestCase
|
|||
assert_equal(2.0, (1.0..2.0).max)
|
||||
assert_equal(nil, (2.0..1.0).max)
|
||||
assert_raise(TypeError) { (1.0...2.0).max }
|
||||
assert_raise(TypeError) { (1...1.5).max }
|
||||
assert_raise(TypeError) { (1.5...2).max }
|
||||
|
||||
assert_equal(-0x80000002, ((-0x80000002)...(-0x80000001)).max)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue