1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Ignore warnings about ambiguous first argument with the negative integer.

This commit is contained in:
Hiroshi SHIBATA 2019-06-01 15:07:35 +03:00
parent 9eecd7a2fd
commit 3c77ef9adc
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2
2 changed files with 18 additions and 18 deletions

View file

@ -91,22 +91,22 @@ class JSONParserTest < Test::Unit::TestCase
assert_raise(JSON::ParserError) { parse('+23') }
assert_raise(JSON::ParserError) { parse('.23') }
assert_raise(JSON::ParserError) { parse('023') }
assert_equal 23, parse('23')
assert_equal -23, parse('-23')
assert_equal_float 3.141, parse('3.141')
assert_equal_float -3.141, parse('-3.141')
assert_equal_float 3.141, parse('3141e-3')
assert_equal_float 3.141, parse('3141.1e-3')
assert_equal_float 3.141, parse('3141E-3')
assert_equal_float 3.141, parse('3141.0E-3')
assert_equal_float -3.141, parse('-3141.0e-3')
assert_equal_float -3.141, parse('-3141e-3')
assert_equal(23, parse('23'))
assert_equal(-23, parse('-23'))
assert_equal_float(3.141, parse('3.141'))
assert_equal_float(-3.141, parse('-3.141'))
assert_equal_float(3.141, parse('3141e-3'))
assert_equal_float(3.141, parse('3141.1e-3'))
assert_equal_float(3.141, parse('3141E-3'))
assert_equal_float(3.141, parse('3141.0E-3'))
assert_equal_float(-3.141, parse('-3141.0e-3'))
assert_equal_float(-3.141, parse('-3141e-3'))
assert_raise(ParserError) { parse('NaN') }
assert parse('NaN', :allow_nan => true).nan?
assert_raise(ParserError) { parse('Infinity') }
assert_equal 1.0/0, parse('Infinity', :allow_nan => true)
assert_equal(1.0/0, parse('Infinity', :allow_nan => true))
assert_raise(ParserError) { parse('-Infinity') }
assert_equal -1.0/0, parse('-Infinity', :allow_nan => true)
assert_equal(-1.0/0, parse('-Infinity', :allow_nan => true))
end
def test_parse_bigdecimals

View file

@ -409,12 +409,12 @@ class OpenSSL::TestX509Name < OpenSSL::TestCase
n2 = OpenSSL::X509::Name.new([["CN", "a"]])
n3 = OpenSSL::X509::Name.new([["CN", "ab"]])
assert_equal 0, n1 <=> n2
assert_equal -1, n1 <=> n3
assert_equal 0, n2 <=> n1
assert_equal -1, n2 <=> n3
assert_equal 1, n3 <=> n1
assert_equal 1, n3 <=> n2
assert_equal(0, n1 <=> n2)
assert_equal(-1, n1 <=> n3)
assert_equal(0, n2 <=> n1)
assert_equal(-1, n2 <=> n3)
assert_equal(1, n3 <=> n1)
assert_equal(1, n3 <=> n2)
end
def name_hash(name)