summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-29 05:00:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-29 05:00:46 +0000
commit846c670ae099e101f8b2ba8aee5756a9fbfec899 (patch)
tree7093b61bcaacaa91eb7dc9ebc2629cd86f8a4a44 /test
parent834a35b89d3614a6fbb925ea19b470f9e24339d2 (diff)
downloadruby-846c670ae099e101f8b2ba8aee5756a9fbfec899.tar.gz
ruby-846c670ae099e101f8b2ba8aee5756a9fbfec899.tar.xz
ruby-846c670ae099e101f8b2ba8aee5756a9fbfec899.zip
* io.c (fptr_finalize): must not use FILE after fclose().
[ruby-dev:24985] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/io/nonblock/test_flush.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/io/nonblock/test_flush.rb b/test/io/nonblock/test_flush.rb
new file mode 100644
index 000000000..5ca4beba6
--- /dev/null
+++ b/test/io/nonblock/test_flush.rb
@@ -0,0 +1,22 @@
+require 'test/unit'
+require 'io/nonblock'
+
+class TestIONonblock < Test::Unit::TestCase
+ def test_flush # [ruby-dev:24985]
+ r,w = IO.pipe
+ w.nonblock = true
+ w.sync = false
+ w << "b"
+ w.flush
+ w << "a" * 4096
+ Thread.new {
+ Thread.pass
+ w.close
+ }
+ Thread.new {
+ Thread.pass
+ nil while r.read(4096)
+ }
+ assert_raise(IOError) {w.flush}
+ end
+end