From b9f8fc510f4a13e484da207512f83f21e30c398b Mon Sep 17 00:00:00 2001 From: normal Date: Fri, 19 May 2017 21:33:15 +0000 Subject: test/ruby/test_io.rb: new test for IO.select exception set Ensure this rarely-used feature of IO.select continues to work properly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 1b8179b516..ecf5658d22 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -3553,4 +3553,16 @@ __END__ } 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 -- cgit v1.2.3