summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-14 12:01:50 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-14 12:01:50 +0000
commit433fbebfbc49c330b66089f6d191558b967a84f5 (patch)
treed123587eb0b666e9300c36080de5b267f9f4abc2 /bootstraptest
parenta5c05a9ace5aad5fa9fc545be0be829cf61b16c4 (diff)
* io.c (io_reopen): check STDIN, STDOUT and STDERR mode according to
stdio streams. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_io.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/bootstraptest/test_io.rb b/bootstraptest/test_io.rb
index a5d54af..4974a1e 100644
--- a/bootstraptest/test_io.rb
+++ b/bootstraptest/test_io.rb
@@ -52,3 +52,20 @@ assert_equal 'ok', %q{
File.unlink(tmpname)
:ok
}
+
+assert_equal 'ok', %q{
+ require 'tmpdir'
+ begin
+ tmpname = "#{Dir.tmpdir}/ruby-btest-#{$$}-#{rand(0x100000000).to_s(36)}"
+ rw = File.open(tmpname, File::RDWR|File::CREAT|File::EXCL)
+ rescue Errno::EEXIST
+ retry
+ end
+ save = STDIN.dup
+ STDIN.reopen(rw)
+ STDIN.print "a"
+ STDIN.reopen(save)
+ rw.close
+ File.unlink(tmpname)
+ :ok
+}