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 | 0773b9f1ba5a4cf1b17ef5eacc2db1d914c6c416 (patch) | |
| tree | 00b50c4b264d237624d19632bc9b086feaeac4a8 /test/ruby | |
| parent | f109a742530ab466a6e5946561f4fdaf578f9c76 (diff) | |
| download | ruby-0773b9f1ba5a4cf1b17ef5eacc2db1d914c6c416.tar.gz ruby-0773b9f1ba5a4cf1b17ef5eacc2db1d914c6c416.tar.xz ruby-0773b9f1ba5a4cf1b17ef5eacc2db1d914c6c416.zip | |
* 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: http://svn.ruby-lang.org/repos/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 0c1c6b2d2..0f448dbf3 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" |
