diff options
author | Michael Kohl <me@citizen428.net> | 2020-07-18 23:18:40 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-19 01:18:40 +0900 |
commit | 8a5ad2b77d7a24e4f8f4fef179ae5efced935f91 (patch) | |
tree | 5fe26555ef640a04909c36315659e15bd132e3b2 /test/ruby/test_range.rb | |
parent | b4e784434c54348283c079efb1b8ab9de13c0603 (diff) |
Fix Range#max for beginless Integer ranges [Bug #17034]
* Fix Range#max for beginless Integer ranges
* Update test/ruby/test_range.rb
* Fix formatting
https://github.com/ruby/ruby/pull/3328
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Notes
Notes:
Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'test/ruby/test_range.rb')
-rw-r--r-- | test/ruby/test_range.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb index 9052fe6174..0b3f6c68f6 100644 --- a/test/ruby/test_range.rb +++ b/test/ruby/test_range.rb @@ -127,6 +127,10 @@ class TestRange < Test::Unit::TestCase assert_raise(RangeError) { (1...).max(3) } assert_raise(RangeError) { (..0).min {|a, b| a <=> b } } + + assert_equal(2, (..2).max) + assert_raise(TypeError) { (...2).max } + assert_raise(TypeError) { (...2.0).max } end def test_minmax |