diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-02 23:30:46 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-02 23:30:46 +0000 |
commit | 2df1053c1db22aa5693d4982814e79fcb040c5ab (patch) | |
tree | d412c399dcda63b10e6ed4f4ad33d0e6d8a94228 /test | |
parent | fe39ce87dda92a3c9a76a70d8465da4b4e172567 (diff) | |
download | ruby-2df1053c1db22aa5693d4982814e79fcb040c5ab.tar.gz |
add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/socket/test_addrinfo.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/socket/test_addrinfo.rb b/test/socket/test_addrinfo.rb index a8e1dc7f21..8b2842561f 100644 --- a/test/socket/test_addrinfo.rb +++ b/test/socket/test_addrinfo.rb @@ -300,6 +300,15 @@ class TestSocketAddrInfo < Test::Unit::TestCase s2.close if s2 && !s2.closed? end + def test_family_addrinfo + ai = AddrInfo.tcp("0.0.0.0", 4649).family_addrinfo("www.ruby-lang.org", 80) + assert_equal(["221.186.184.68", 80], ai.ip_unpack) + assert_equal(Socket::SOCK_STREAM, ai.socktype) + ai = AddrInfo.unix("/tmp/sock").family_addrinfo("/tmp/sock2") + assert_equal("/tmp/sock2", ai.unix_path) + assert_equal(Socket::SOCK_STREAM, ai.socktype) + end + def test_marshal ai1 = AddrInfo.tcp("127.0.0.1", 80) ai2 = Marshal.load(Marshal.dump(ai1)) |