diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-03 03:50:28 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-03 03:50:28 +0000 |
commit | 28490dd1fd481587450a25ba1cb259d6c1869e5b (patch) | |
tree | aab17a6d6a15fc586e110a5afe1cb017a0cd8b92 /test | |
parent | eaf301d2be3b437053dfdfe71c76fe0d2da6475f (diff) | |
download | ruby-28490dd1fd481587450a25ba1cb259d6c1869e5b.tar.gz |
process.c: command_name encoding
* process.c (rb_exec_fillarg): share subsequence of argv_buf for
command_name, and copy the encoding from the command string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_system.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_system.rb b/test/ruby/test_system.rb index c56e2a13c4..edc70a4496 100644 --- a/test/ruby/test_system.rb +++ b/test/ruby/test_system.rb @@ -181,5 +181,21 @@ class TestSystem < Test::Unit::TestCase assert_raise_with_message(RuntimeError, /\ACommand failed with exit /) do system("'#{ruby}' -e abort", exception: true) end + + Dir.mktmpdir("ruby_script_tmp") do |tmpdir| + name = "\u{30c6 30b9 30c8}" + tmpfilename = "#{tmpdir}/#{name}.cmd" + message = /#{name}\.cmd/ + e = assert_raise_with_message(Errno::ENOENT, message) do + system(tmpfilename, exception: true) + end + open(tmpfilename, "w") {|f| + f.puts "exit 127" + f.chmod(0755) + } + e = assert_raise_with_message(RuntimeError, message) do + system(tmpfilename, exception: true) + end + end end end |