mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test/ruby/test_float.rb: suppress an overflow warning
``` warning: Float 0xf.fp10000000000000... out of range ```
This commit is contained in:
parent
e83ec207cd
commit
06574ad945
1 changed files with 6 additions and 1 deletions
|
@ -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) }
|
||||
|
|
Loading…
Reference in a new issue