diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-30 05:40:19 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-30 05:40:19 +0000 |
| commit | 0d6e3be34219495669f0c27b341e96877f702f79 (patch) | |
| tree | e39680b86c1d948fd525eb78bdf3e1e9a2615f7d /test/ruby | |
| parent | d45d994615098a0a1359c2947a3d52728f1a9d02 (diff) | |
| download | ruby-0d6e3be34219495669f0c27b341e96877f702f79.tar.gz ruby-0d6e3be34219495669f0c27b341e96877f702f79.tar.xz ruby-0d6e3be34219495669f0c27b341e96877f702f79.zip | |
* process.c (check_exec_redirect_fd): prohibit duplex IO.
(check_exec_fds): record maxhint even if close_others is not
specified.
(rb_exec_arg_fixup): renamed from rb_exec_arg_fix.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_process.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 16340f9c3..7a37723f3 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -523,6 +523,24 @@ class TestProcess < Test::Unit::TestCase } end + def test_execopts_redirect_self + with_pipe {|r, w| + w << "haha\n" + w.close + r.close_on_exec = true + IO.popen([RUBY, "-e", "print IO.new(#{r.fileno}).read", r.fileno=>r.fileno, :close_others=>false]) {|io| + assert_equal("haha\n", io.read) + } + } + end + + def test_execopts_duplex_io + IO.popen("#{RUBY} -e ''", "r+") {|duplex| + assert_raise(ArgumentError) { system("#{RUBY} -e ''", duplex=>STDOUT) } + assert_raise(ArgumentError) { system("#{RUBY} -e ''", STDOUT=>duplex) } + } + end + def test_execopts_modification h = {} Process.wait spawn(*TRUECOMMAND, h) |
