summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-30 12:51:14 (GMT)
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-30 12:51:14 (GMT)
commit0e94f4a002329ace9a8831f03361badb87a9344a (patch)
tree97e929d17780e7f40b6fe30c6ea1338e8436c487 /test
parentae4fba31672956462d8d88c9e473f9cbf30e2f2a (diff)
* test/socket/test_addrinfo.rb (TestSocketAddrinfo#test_addrinfo_ip): previous
test logic depended on platform specific implementation. use more portable logic. this fixes a test failure on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/socket/test_addrinfo.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/socket/test_addrinfo.rb b/test/socket/test_addrinfo.rb
index 401bd6e..e010731 100644
--- a/test/socket/test_addrinfo.rb
+++ b/test/socket/test_addrinfo.rb
@@ -37,9 +37,11 @@ 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("00000000001.000000000.00000000.0000001x".chop)
+ base_str = "127.0.0.1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ addr = base_str[0, 9]
+ Addrinfo.ip(addr)
end
- assert_equal([0, "1.0.0.1"], Socket.unpack_sockaddr_in(ai))
+ assert_equal([0, "127.0.0.1"], Socket.unpack_sockaddr_in(ai))
end
def test_addrinfo_tcp