summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-04 10:17:34 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-04 10:17:34 +0000
commit78c46daca45ee2e19037696b358b171e3af6a053 (patch)
tree7cfca5fea601bc42cbcc622a1e8b69a5454994f5 /test
parent69bc08907020e663147bc29fb7f1b01877436ff9 (diff)
downloadruby-78c46daca45ee2e19037696b358b171e3af6a053.tar.gz
ruby-78c46daca45ee2e19037696b358b171e3af6a053.tar.xz
ruby-78c46daca45ee2e19037696b358b171e3af6a053.zip
* process.c (check_exec_fds): resolve cascaded child fd reference.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_process.rb25
1 files changed, 17 insertions, 8 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index 827dde484..ea9024465 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -417,21 +417,30 @@ class TestProcess < Test::Unit::TestCase
def test_execopts_redirect_dup2_child
with_tmpchdir {|d|
- Process.wait spawn(RUBY, "-e", "STDERR.print 'err'; STDOUT.print 'out'", STDOUT=>"out", STDERR=>[:child, STDOUT])
+ Process.wait spawn(RUBY, "-e", "STDERR.print 'err'; STDOUT.print 'out'",
+ STDOUT=>"out", STDERR=>[:child, STDOUT])
assert_equal("errout", File.read("out"))
- Process.wait spawn(RUBY, "-e", "STDERR.print 'err'; STDOUT.print 'out'", STDERR=>"out", STDOUT=>[:child, STDERR])
+
+ Process.wait spawn(RUBY, "-e", "STDERR.print 'err'; STDOUT.print 'out'",
+ STDERR=>"out", STDOUT=>[:child, STDERR])
+ assert_equal("errout", File.read("out"))
+
+ Process.wait spawn(RUBY, "-e", "STDERR.print 'err'; STDOUT.print 'out'",
+ STDOUT=>"out",
+ STDERR=>[:child, 3],
+ 3=>[:child, 4],
+ 4=>[:child, STDOUT]
+ )
assert_equal("errout", File.read("out"))
IO.popen([RUBY, "-e", "STDERR.print 'err'; STDOUT.print 'out'", STDERR=>[:child, STDOUT]]) {|io|
assert_equal("errout", io.read)
}
- assert_raise(ArgumentError) {
- Process.wait spawn(*TRUECOMMAND, STDOUT=>[:child, STDOUT])
- }
- assert_raise(ArgumentError) {
- Process.wait spawn(*TRUECOMMAND, STDOUT=>[:child, 3])
- }
+ assert_raise(ArgumentError) { Process.wait spawn(*TRUECOMMAND, STDOUT=>[:child, STDOUT]) }
+ assert_raise(ArgumentError) { Process.wait spawn(*TRUECOMMAND, 3=>[:child, 4], 4=>[:child, 3]) }
+ assert_raise(ArgumentError) { Process.wait spawn(*TRUECOMMAND, 3=>[:child, 4], 4=>[:child, 5], 5=>[:child, 3]) }
+ assert_raise(ArgumentError) { Process.wait spawn(*TRUECOMMAND, STDOUT=>[:child, 3]) }
}
end