aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-30 06:12:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-30 06:12:13 +0000
commitf90c8a17a208de0ee644e47654d91b2dbb320e63 (patch)
treeac49e0ae1535a4e9e132b4f239a25fe498a56a53
parent3a6a54f9d83c7f5f8c83fefd5958fc69797d5061 (diff)
downloadruby-f90c8a17a208de0ee644e47654d91b2dbb320e63.tar.gz
test_addrinfo.rb: special hostnames
* test/socket/test_addrinfo.rb (test_addrinfo_ip): add tests for special hostnames, <any> and <broadcast>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/socket/test_addrinfo.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/socket/test_addrinfo.rb b/test/socket/test_addrinfo.rb
index 02cd714d91..9908278bbd 100644
--- a/test/socket/test_addrinfo.rb
+++ b/test/socket/test_addrinfo.rb
@@ -29,6 +29,12 @@ class TestSocketAddrinfo < Test::Unit::TestCase
assert_equal(Socket::PF_INET, ai.pfamily)
assert_equal(0, ai.socktype)
assert_equal(0, ai.protocol)
+
+ ai = Addrinfo.ip("<any>")
+ assert_equal([0, "0.0.0.0"], Socket.unpack_sockaddr_in(ai))
+
+ ai = Addrinfo.ip("<broadcast>")
+ assert_equal([0, "255.255.255.255"], Socket.unpack_sockaddr_in(ai))
end
def test_addrinfo_tcp