diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-04 13:25:01 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-04 13:25:01 +0000 |
commit | 440dc6b7e0b3b74db221eed81871516e301d4b3e (patch) | |
tree | da2d525cec0aec92ba77299a958b6f8e2abcfc04 /test/io/nonblock/test_flush.rb | |
parent | b833c34f8cafa2fbf1355f26658bd05a8454c2d9 (diff) | |
download | ruby-440dc6b7e0b3b74db221eed81871516e301d4b3e.tar.gz |
Improve line covearge of ext/io/nonblock/nonblock.c from 54.5% to 95.5%
Not so good test, but it would be better than nothing, I guess...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/io/nonblock/test_flush.rb')
-rw-r--r-- | test/io/nonblock/test_flush.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/io/nonblock/test_flush.rb b/test/io/nonblock/test_flush.rb index bc60cab8bf..e014a5f3db 100644 --- a/test/io/nonblock/test_flush.rb +++ b/test/io/nonblock/test_flush.rb @@ -50,4 +50,22 @@ class TestIONonblock < Test::Unit::TestCase assert_equal(4097, result.size) true end + + def test_nonblock + IO.pipe {|r, w| + assert_equal(false, w.nonblock?) + w.nonblock do + assert_equal(true, w.nonblock?) + w.nonblock(false) do + assert_equal(false, w.nonblock?) + w.nonblock(false) do + assert_equal(false, w.nonblock?) + end + assert_equal(false, w.nonblock?) + end + assert_equal(true, w.nonblock?) + end + assert_equal(false, w.nonblock?) + } + end end if IO.method_defined?(:nonblock) |