diff options
| author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-24 02:37:51 +0000 |
|---|---|---|
| committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-24 02:37:51 +0000 |
| commit | 3489138ee9dc2c2385a161225a9c05081c1f3092 (patch) | |
| tree | 269ff896cdd2f6f397e020a826f4dd4fcdfbe6cc | |
| parent | 040bf28e0773a748ac14427a51738bb6f07dbd95 (diff) | |
| download | ruby-3489138ee9dc2c2385a161225a9c05081c1f3092.tar.gz ruby-3489138ee9dc2c2385a161225a9c05081c1f3092.tar.xz ruby-3489138ee9dc2c2385a161225a9c05081c1f3092.zip | |
* test/ruby/test_process.rb (test_exec_wordsplit): on win32, exec'ed process is not child but grandchild.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | test/ruby/test_process.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 199869246..fd362d418 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -684,7 +684,13 @@ class TestProcess < Test::Unit::TestCase def test_exec_wordsplit with_tmpchdir {|d| 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 End write_file("s", <<-"End") @@ -697,7 +703,12 @@ class TestProcess < Test::Unit::TestCase assert_equal(pid, status.pid) assert(status.exited?) 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 |
