Skip to content

Commit e7245b7

Browse files
etiennebarriebyroot
authored andcommitted
Remove bignum warnings
test/json/json_parser_test.rb:141: warning: Integer out of Float range lib/json/common.rb:353: warning: Float 12345678901234567890... out of range
1 parent 9602edb commit e7245b7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/json/json_parser_test.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ def test_parse_bignum
138138

139139
bignum = Integer('1234567890' * 50)
140140
assert_equal(bignum, JSON.parse(bignum.to_s))
141-
assert_equal(bignum.to_f, JSON.parse(bignum.to_s + ".0"))
141+
bignum_float = EnvUtil.suppress_warning { bignum.to_f }
142+
assert_equal(bignum_float, EnvUtil.suppress_warning { JSON.parse(bignum.to_s + ".0") })
142143
end
143144

144145
def test_parse_bigdecimals

0 commit comments

Comments
 (0)