mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
b833c34f8c
commit
440dc6b7e0
2 changed files with 19 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
/**********************************************************************
|
||||
|
||||
io/wait.c -
|
||||
io/nonblock.c -
|
||||
|
||||
$Author$
|
||||
created at: Tue Jul 14 21:53:18 2009
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue