mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
aaf6bde978
commit
78d7def619
1 changed files with 19 additions and 0 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Reference in a new issue