test/ruby: suppress runtime warnings

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-02-19 07:58:09 +00:00
parent 41f4317f45
commit c7f815eed8
10 changed files with 36 additions and 29 deletions

View file

@ -904,7 +904,8 @@ class Rational_Test < Test::Unit::TestCase
def test_fixed_bug
n = Float::MAX.to_i * 2
assert_equal(1.0, Rational(n + 2, n + 1).to_f, '[ruby-dev:33852]')
x = EnvUtil.suppress_warning {Rational(n + 2, n + 1).to_f}
assert_equal(1.0, x, '[ruby-dev:33852]')
end
def test_power_of_1_and_minus_1