From 06574ad945dcce0bf626b3af020810230b169b56 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Wed, 31 Jul 2019 14:35:21 +0900 Subject: test/ruby/test_float.rb: suppress an overflow warning ``` warning: Float 0xf.fp10000000000000... out of range ``` --- test/ruby/test_float.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/ruby/test_float.rb') 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) } -- cgit v1.2.3