summaryrefslogtreecommitdiffstats
path: root/test/socket/test_addrinfo.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-04 15:42:13 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-04 15:42:13 +0000
commitbfc9c99715be13a8053067d8900b2219c10534e1 (patch)
tree1cfb2847635726352210d8d3ebb90483a5079456 /test/socket/test_addrinfo.rb
parentca4c991cddf739c3319491cade7baebda250e9fb (diff)
downloadruby-bfc9c99715be13a8053067d8900b2219c10534e1.tar.gz
ruby-bfc9c99715be13a8053067d8900b2219c10534e1.tar.xz
ruby-bfc9c99715be13a8053067d8900b2219c10534e1.zip
test relaxed.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/socket/test_addrinfo.rb')
-rw-r--r--test/socket/test_addrinfo.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/socket/test_addrinfo.rb b/test/socket/test_addrinfo.rb
index 8ddbb0698..d75ce3b7a 100644
--- a/test/socket/test_addrinfo.rb
+++ b/test/socket/test_addrinfo.rb
@@ -514,12 +514,16 @@ class TestSocketAddrInfo < Test::Unit::TestCase
end
def test_ipv6_to_ipv4
- ai = AddrInfo.ip("::192.0.2.3").ipv6_to_ipv4
+ ai = AddrInfo.ip("::192.0.2.3")
+ ai = ai.ipv6_to_ipv4 if !ai.ipv4?
assert(ai.ipv4?)
assert_equal("192.0.2.3", ai.ip_address)
- ai = AddrInfo.ip("::ffff:192.0.2.3").ipv6_to_ipv4
+
+ ai = AddrInfo.ip("::ffff:192.0.2.3")
+ ai = ai.ipv6_to_ipv4 if !ai.ipv4?
assert(ai.ipv4?)
assert_equal("192.0.2.3", ai.ip_address)
+
assert_nil(AddrInfo.ip("::1").ipv6_to_ipv4)
assert_nil(AddrInfo.ip("192.0.2.3").ipv6_to_ipv4)
if HAS_UNIXSOCKET