summaryrefslogtreecommitdiff
path: root/test/ruby/test_float.rb
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2019-07-31 14:35:21 +0900
committerYusuke Endoh <mame@ruby-lang.org>2019-07-31 14:35:54 +0900
commit06574ad945dcce0bf626b3af020810230b169b56 (patch)
tree08e7f5f59eb99a7626da4239573f787821680561 /test/ruby/test_float.rb
parente83ec207cd5fda973c41d6629d8504b515522b12 (diff)
test/ruby/test_float.rb: suppress an overflow warning
``` warning: Float 0xf.fp10000000000000... out of range ```
Diffstat (limited to 'test/ruby/test_float.rb')
-rw-r--r--test/ruby/test_float.rb7
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) }