diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-29 05:21:47 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-29 05:21:47 +0000 |
commit | 6e221605373ff89fd52d08d5df86cfb0bd805de7 (patch) | |
tree | d75eed961dda68ceb46b769a14424f5551818e97 /test/io/nonblock | |
parent | e73b5c9bfcd0563496a7bfbd113f505edb4d2c81 (diff) |
* test/io/nonblock/test_flush.rb: test transferred data.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/io/nonblock')
-rw-r--r-- | test/io/nonblock/test_flush.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/io/nonblock/test_flush.rb b/test/io/nonblock/test_flush.rb index 5ca4beba60..dbe20722cf 100644 --- a/test/io/nonblock/test_flush.rb +++ b/test/io/nonblock/test_flush.rb @@ -13,10 +13,14 @@ class TestIONonblock < Test::Unit::TestCase Thread.pass w.close } - Thread.new { - Thread.pass - nil while r.read(4096) + result = "" + t = Thread.new { + while (Thread.pass; s = r.read(4096)) + result << s + end } assert_raise(IOError) {w.flush} + t.join + assert_equal("b", result) end end |