[前][次][番号順一覧][スレッド一覧]

ruby-changes:43137

From: nobu <ko1@a...>
Date: Mon, 30 May 2016 15:12:17 +0900 (JST)
Subject: [ruby-changes:43137] nobu:r55211 (trunk): test_addrinfo.rb: special hostnames

nobu	2016-05-30 15:12:13 +0900 (Mon, 30 May 2016)

  New Revision: 55211

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55211

  Log:
    test_addrinfo.rb: special hostnames
    
    * test/socket/test_addrinfo.rb (test_addrinfo_ip): add tests for
      special hostnames, <any> and <broadcast>.

  Modified files:
    trunk/test/socket/test_addrinfo.rb
Index: test/socket/test_addrinfo.rb
===================================================================
--- test/socket/test_addrinfo.rb	(revision 55210)
+++ test/socket/test_addrinfo.rb	(revision 55211)
@@ -29,6 +29,12 @@ class TestSocketAddrinfo < Test::Unit::T https://github.com/ruby/ruby/blob/trunk/test/socket/test_addrinfo.rb#L29
     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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]