From 3e7d002118a92fad5934e11c75be6768a1476c1b Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 11 Jul 2019 19:20:53 +0900 Subject: Check exception flag as a bool [Bug #15987] --- test/ruby/test_io.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/ruby/test_io.rb') 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 { -- cgit v1.2.3