diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-24 07:55:05 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-24 07:55:05 +0000 |
commit | 43a118defe61bc48267fc5626723dba32b2bd821 (patch) | |
tree | c5bbc6f01381965bd8a21085b56773345b7779bb /test/io | |
parent | e55ff51ac706fc46eca133b614fff001c580650d (diff) | |
download | ruby-43a118defe61bc48267fc5626723dba32b2bd821.tar.gz |
wait readable/writable
* ext/io/wait/wait.c (io_wait_readwrite): [EXPERIMENTAL] allow to
wait for multiple modes, readable and writable, at once. the
arguments may change in the future. [Feature #12013]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/io')
-rw-r--r-- | test/io/wait/test_io_wait.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/io/wait/test_io_wait.rb b/test/io/wait/test_io_wait.rb index a19d2a1ea9..7b9edea587 100644 --- a/test/io/wait/test_io_wait.rb +++ b/test/io/wait/test_io_wait.rb @@ -134,6 +134,18 @@ class TestIOWait < Test::Unit::TestCase assert_raise(IOError) { @w.wait_writable } end + def test_wait_readwrite + assert_equal @r.wait(0, :write), @r.wait(0, :read_write) + end + + def test_wait_readwrite_timeout + assert_equal @w, @w.wait(0.01, :read_write) + written = fill_pipe + assert_nil @w.wait(0.01, :read_write) + @r.read(written) + assert_equal @w, @w.wait(0.01, :read_write) + end + private def fill_pipe |