diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-12 09:36:52 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-12 09:36:52 +0000 |
commit | 4e28fdf417fcd2d9492277b46a556264ab9ba0de (patch) | |
tree | ffcea426128a06fc8382471729cf1416385ed11d /test | |
parent | 62c17a2f21b47243071075cbef37fe72b6ecd0ff (diff) | |
download | ruby-4e28fdf417fcd2d9492277b46a556264ab9ba0de.tar.gz |
No FloatDomainError at non-finitive number if exception: false
[ruby-core:91021] [Bug #15525]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_integer.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_integer.rb b/test/ruby/test_integer.rb index a73992787d..69347b6b11 100644 --- a/test/ruby/test_integer.rb +++ b/test/ruby/test_integer.rb @@ -175,6 +175,15 @@ class TestInteger < Test::Unit::TestCase def o.to_int; raise; end assert_equal(nil, Integer(o, exception: false)) } + assert_nothing_raised(FloatDomainError) { + assert_equal(nil, Integer(Float::INFINITY, exception: false)) + } + assert_nothing_raised(FloatDomainError) { + assert_equal(nil, Integer(-Float::INFINITY, exception: false)) + } + assert_nothing_raised(FloatDomainError) { + assert_equal(nil, Integer(Float::NAN, exception: false)) + } assert_raise(ArgumentError) { Integer("1z", exception: true) |