summaryrefslogtreecommitdiff
path: root/test/io/nonblock/test_flush.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-29 05:21:47 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-29 05:21:47 +0000
commit6e221605373ff89fd52d08d5df86cfb0bd805de7 (patch)
treed75eed961dda68ceb46b769a14424f5551818e97 /test/io/nonblock/test_flush.rb
parente73b5c9bfcd0563496a7bfbd113f505edb4d2c81 (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/test_flush.rb')
-rw-r--r--test/io/nonblock/test_flush.rb10
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