From 6e221605373ff89fd52d08d5df86cfb0bd805de7 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 29 Nov 2004 05:21:47 +0000 Subject: * 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 --- test/io/nonblock/test_flush.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'test/io') 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 -- cgit v1.2.3