From 78d7def61988764344d2630ae77113e1edb2af5d Mon Sep 17 00:00:00 2001 From: akr Date: Wed, 6 Jun 2012 12:11:45 +0000 Subject: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_process.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index d8f127eab7..4ff4023b51 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -870,6 +870,25 @@ class TestProcess < Test::Unit::TestCase } end + def test_popen_wordsplit_beginning_and_trailing_spaces + with_tmpchdir {|d| + write_file("script", <<-'End') + print "fufumm pid=#{$$} ppid=#{Process.ppid}" + exit 7 + End + str = " #{RUBY} script " + io = IO.popen(str) + pid = io.pid + result = io.read + io.close + status = $? + assert_equal(pid, status.pid) + assert(status.exited?) + assert_equal(7, status.exitstatus) + assert_equal("fufumm pid=#{status.pid} ppid=#{$$}", result) + } + end + def test_exec_wordsplit with_tmpchdir {|d| write_file("script", <<-'End') -- cgit v1.2.3