summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-19 21:33:15 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-19 21:33:15 +0000
commitb9f8fc510f4a13e484da207512f83f21e30c398b (patch)
treed85900e3ed238ea4b331efc90cb34456223b3c4c /test
parentea1ce47fd7f2bc9023e9a1391dbadcfaf9e892ce (diff)
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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io.rb12
1 files changed, 12 insertions, 0 deletions
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