summaryrefslogtreecommitdiff
path: root/test/ruby/test_io.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_io.rb')
-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 4f66685f9b..3c5dc7671a 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -1509,6 +1509,12 @@ class TestIO < Test::Unit::TestCase
}
end if have_nonblock?
+ def test_read_nonblock_invalid_exception
+ with_pipe {|r, w|
+ assert_raise(ArgumentError) {r.read_nonblock(4096, exception: 1)}
+ }
+ end if have_nonblock?
+
def test_read_nonblock_no_exceptions
skip '[ruby-core:90895] MJIT worker may leave fd open in a forked child' if RubyVM::MJIT.enabled? # TODO: consider acquiring GVL from MJIT worker.
with_pipe {|r, w|
@@ -1545,6 +1551,12 @@ class TestIO < Test::Unit::TestCase
}
end if have_nonblock?
+ def test_write_nonblock_invalid_exception
+ with_pipe {|r, w|
+ assert_raise(ArgumentError) {w.write_nonblock(4096, exception: 1)}
+ }
+ end if have_nonblock?
+
def test_write_nonblock_no_exceptions
with_pipe {|r, w|
loop {