summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-30 06:12:13 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-30 06:12:13 (GMT)
commitbfc9c3766f3efd58002bd6e58074c16322abd852 (patch)
treeac49e0ae1535a4e9e132b4f239a25fe498a56a53 /test
parentea7373574ad4703dac977b0f3e7cd332f2acd0b8 (diff)
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
Diffstat (limited to 'test')
-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 02cd714..9908278 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