mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_process.rb (test_exec_wordsplit): on win32, exec'ed process is not child but grandchild.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d3a0ef8198
commit
5bf133eb50
1 changed files with 13 additions and 2 deletions
|
@ -684,7 +684,13 @@ class TestProcess < Test::Unit::TestCase
|
||||||
def test_exec_wordsplit
|
def test_exec_wordsplit
|
||||||
with_tmpchdir {|d|
|
with_tmpchdir {|d|
|
||||||
write_file("script", <<-'End')
|
write_file("script", <<-'End')
|
||||||
File.open("result", "w") {|t| t << "hehe pid=#{$$} ppid=#{Process.ppid}" }
|
File.open("result", "w") {|t|
|
||||||
|
if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
|
||||||
|
t << "hehe ppid=#{Process.ppid}"
|
||||||
|
else
|
||||||
|
t << "hehe pid=#{$$} ppid=#{Process.ppid}"
|
||||||
|
end
|
||||||
|
}
|
||||||
exit 6
|
exit 6
|
||||||
End
|
End
|
||||||
write_file("s", <<-"End")
|
write_file("s", <<-"End")
|
||||||
|
@ -697,7 +703,12 @@ class TestProcess < Test::Unit::TestCase
|
||||||
assert_equal(pid, status.pid)
|
assert_equal(pid, status.pid)
|
||||||
assert(status.exited?)
|
assert(status.exited?)
|
||||||
assert_equal(6, status.exitstatus)
|
assert_equal(6, status.exitstatus)
|
||||||
assert_equal("hehe pid=#{status.pid} ppid=#{$$}", File.read("result"))
|
if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
|
||||||
|
expected = "hehe ppid=#{status.pid}"
|
||||||
|
else
|
||||||
|
expected = "hehe pid=#{status.pid} ppid=#{$$}"
|
||||||
|
end
|
||||||
|
assert_equal(expected, File.read("result"))
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue