test_addrinfo.rb: signle digit address

* test/socket/test_addrinfo.rb (test_addrinfo_ip): use single
  digit address so that the values are same in both decimal and
  octal.  some platform zero-prefixed dotted-decimal is parsed as
  an octal value.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-05-30 11:23:32 +00:00
parent 85950c5257
commit 632097082b

View File

@ -37,9 +37,9 @@ class TestSocketAddrinfo < Test::Unit::TestCase
assert_equal([0, "255.255.255.255"], Socket.unpack_sockaddr_in(ai))
ai = assert_nothing_raised(SocketError) do
Addrinfo.ip("00000000127.000000000.00000000.0000001x".chop)
Addrinfo.ip("00000000001.000000000.00000000.0000001x".chop)
end
assert_equal([0, "127.0.0.1"], Socket.unpack_sockaddr_in(ai))
assert_equal([0, "1.0.0.1"], Socket.unpack_sockaddr_in(ai))
end
def test_addrinfo_tcp