aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_io.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-11 19:20:53 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-11 20:04:29 +0900
commit3e7d002118a92fad5934e11c75be6768a1476c1b (patch)
treee9f437327b5c743622a97c092ddadc2d99cb0bc5 /test/ruby/test_io.rb
parentcd069df36596d9bf7a6db8aaa0dcefdafb233a91 (diff)
downloadruby-3e7d002118a92fad5934e11c75be6768a1476c1b.tar.gz
Check exception flag as a bool [Bug #15987]
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 {