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

ruby-changes:46691

From: normal <ko1@a...>
Date: Sat, 20 May 2017 06:33:25 +0900 (JST)
Subject: [ruby-changes:46691] normal:r58806 (trunk): test/ruby/test_io.rb: new test for IO.select exception set

normal	2017-05-20 06:33:15 +0900 (Sat, 20 May 2017)

  New Revision: 58806

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

  Log:
    test/ruby/test_io.rb: new test for IO.select exception set
    
    Ensure this rarely-used feature of IO.select continues
    to work properly.

  Modified files:
    trunk/test/ruby/test_io.rb
Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 58805)
+++ test/ruby/test_io.rb	(revision 58806)
@@ -3553,4 +3553,16 @@ __END__ https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L3553
       }
     end if IO.method_defined?(:pread) and IO.method_defined?(:pwrite)
   end
+
+  def test_select_exceptfds
+    TCPServer.open('localhost', 0) do |svr|
+      con = TCPSocket.new('localhost', svr.addr[1])
+      acc = svr.accept
+      assert_equal 6, con.send('hello', Socket::MSG_OOB)
+      set = IO.select(nil, nil, [acc], 30)
+      assert_equal([[], [], [acc]], set, 'IO#select exceptions array OK')
+      acc.close
+      con.close
+    end
+  end if Socket.const_defined?(:MSG_OOB)
 end

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

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