зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
ea7373574a
Коммит
bfc9c3766f
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче