diff options
Diffstat (limited to 'test/socket/test_addrinfo.rb')
-rw-r--r-- | test/socket/test_addrinfo.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/socket/test_addrinfo.rb b/test/socket/test_addrinfo.rb index 519279c77..d6c264bb8 100644 --- a/test/socket/test_addrinfo.rb +++ b/test/socket/test_addrinfo.rb @@ -134,6 +134,11 @@ class TestSocketAddrInfo < Test::Unit::TestCase s3.close if s3 && !s3.closed? end + def test_socket_getnameinfo + ai = AddrInfo.udp("127.0.0.1", 8888) + assert_equal(["127.0.0.1", "8888"], Socket.getnameinfo(ai, Socket::NI_NUMERICHOST|Socket::NI_NUMERICSERV)) + end + def test_basicsocket_local_address s1 = Socket.new(:INET, :DGRAM, 0) s1.bind(Socket.sockaddr_in(0, "127.0.0.1")) |