diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2019-07-31 14:35:21 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2019-07-31 14:35:54 +0900 |
commit | 06574ad945dcce0bf626b3af020810230b169b56 (patch) | |
tree | 08e7f5f59eb99a7626da4239573f787821680561 /test/ruby | |
parent | e83ec207cd5fda973c41d6629d8504b515522b12 (diff) | |
download | ruby-06574ad945dcce0bf626b3af020810230b169b56.tar.gz |
test/ruby/test_float.rb: suppress an overflow warning
```
warning: Float 0xf.fp10000000000000... out of range
```
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_float.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb index 02bafb0303..7cbf3b5a8f 100644 --- a/test/ruby/test_float.rb +++ b/test/ruby/test_float.rb @@ -788,7 +788,12 @@ class TestFloat < Test::Unit::TestCase assert_raise(ArgumentError) { Float('0xf.p0') } assert_raise(ArgumentError) { Float('0xf.f') } assert_raise(ArgumentError) { Float('0xf.fp') } - assert_equal(Float::INFINITY, Float('0xf.fp1000000000000000')) + begin + verbose_bak, $VERBOSE = $VERBOSE, nil + assert_equal(Float::INFINITY, Float('0xf.fp1000000000000000')) + ensure + $VERBOSE = verbose_bak + end assert_equal(1, suppress_warning {Float("1e10_00")}.infinite?) assert_raise(TypeError) { Float(nil) } assert_raise(TypeError) { Float(:test) } |