diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-21 15:57:52 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-21 15:57:52 +0000 |
commit | 9cfe35ad503cd6bb598dea85517949b932719afe (patch) | |
tree | 00b50c4b264d237624d19632bc9b086feaeac4a8 /test/ruby | |
parent | 6adda0379c0dc2b2f881060cba2ad40493e59608 (diff) | |
download | ruby-9cfe35ad503cd6bb598dea85517949b932719afe.tar.gz |
* io.c (io_getpartial): error message describes what should be
waited after nonblocking error.
(rb_io_write_nonblock): ditto.
* ext/socket/init.c (s_recvfrom_nonblock): ditto.
(s_accept_nonblock): ditto.
* ext/socket/socket.c (sock_connect_nonblock): ditto.
* ext/socket/ancdata.c (bsock_sendmsg_internal): ditto.
(bsock_recvmsg_internal): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_io.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 0c1c6b2d2b..0f448dbf39 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -857,6 +857,30 @@ class TestIO < Test::Unit::TestCase end) end + def test_read_nonblock_error + return if !have_nonblock? + with_pipe {|r, w| + begin + r.read_nonblock 4096 + rescue Errno::EWOULDBLOCK + assert_match(/WANT_READ/, $!.message) + end + } + end + + def test_write_nonblock_error + return if !have_nonblock? + with_pipe {|r, w| + begin + loop { + w.write_nonblock "a"*100000 + } + rescue Errno::EWOULDBLOCK + assert_match(/WANT_WRITE/, $!.message) + end + } + end + def test_gets pipe(proc do |w| w.write "foobarbaz" |