summaryrefslogtreecommitdiff
path: root/test/ruby/test_process.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-30 01:59:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-30 01:59:21 +0000
commit637d668bcae880566b59d6578f5cfe924ef06f1a (patch)
tree8d36d4e3650d2f7cfcd72bf6c914996558575f63 /test/ruby/test_process.rb
parent8d2ce0fb1f71da75a4f937ff06527bc24ecc8dd4 (diff)
win32: UTF-8 spawn
* io.c (spawnv, spawn): use UTF-8 spawn family. [Bug #1771] * process.c (proc_exec_sh, proc_spawn_cmd, proc_spawn_sh): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_process.rb')
-rw-r--r--test/ruby/test_process.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index dfe91f2888..6f14c8d121 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -16,6 +16,9 @@ class TestProcess < Test::Unit::TestCase
end
def windows?
+ self.class.windows?
+ end
+ def self.windows?
return /mswin|mingw|bccwin/ =~ RUBY_PLATFORM
end
@@ -1608,6 +1611,28 @@ EOS
end
end
+ def test_spawn_nonascii
+ bug1771 = '[ruby-core:24309] [Bug #1771]'
+ with_tmpchdir do
+ [
+ "\u{7d05 7389}",
+ "zuf\u{00E4}llige_\u{017E}lu\u{0165}ou\u{010D}k\u{00FD}_\u{10D2 10D0 10DB 10D4 10DD 10E0 10D4 10D1}_\u{0440 0430 0437 043B 043E 0433 0430}_\u{548C 65B0 52A0 5761 4EE5 53CA 4E1C}",
+ # "c\u{1EE7}a", # work with a backslash, but not with a slash, for some reason.
+ ].each do |name|
+ msg = "#{bug1771} #{name}"
+ exename = "./#{name}.exe"
+ FileUtils.cp(ENV["COMSPEC"], exename)
+ assert_equal(true, system("#{exename} /c exit"), msg)
+ system("#{exename} /c exit 12")
+ assert_equal(12, $?.exitstatus, msg)
+ _, status = Process.wait2(Process.spawn("#{exename} /c exit 42"))
+ assert_equal(42, status.exitstatus, msg)
+ assert_equal("ok\n", `#{exename} /c echo ok`, msg)
+ assert_equal("ok\n", IO.popen("#{exename} /c echo ok", &:read), msg)
+ assert_equal("ok\n", IO.popen(%W"#{exename} /c echo ok", &:read), msg)
+ end
+ end
+ end if windows?
end