summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2024-10-18 11:22:30 +0900
committernagachika <nagachika@ruby-lang.org>2024-10-18 11:22:30 +0900
commit48af30b068729058c2f45375e67fa76f6240a228 (patch)
treec98e1c8c8b1568adba4caa6fd56c93811efced12 /test/ruby
parent3d4d5c8d8cca0c290a234fb3c47c035822b18add (diff)
merge revision(s) d33e3d47b84a73b38644f2a3d41881ce9be6ef18: [Backport #20704]
[Bug #20704] Win32: Fix chdir to non-ASCII path On Windows, `chdir` in compilers' runtime libraries uses the active code page, but command line arguments in ruby are always UTF-8, since commit:33ea2646b98adb49ae2e1781753bf22d33729ac0.
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_rubyoptions.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index 15c9f293ed..534923ecb5 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -196,7 +196,7 @@ class TestRubyOptions < Test::Unit::TestCase
def test_kanji
assert_in_out_err(%w(-KU), "p '\u3042'") do |r, e|
- assert_equal("\"\u3042\"", r.join.force_encoding(Encoding::UTF_8))
+ assert_equal("\"\u3042\"", r.join('').force_encoding(Encoding::UTF_8))
end
line = '-eputs"\xc2\xa1".encoding'
env = {'RUBYOPT' => nil}
@@ -312,9 +312,20 @@ class TestRubyOptions < Test::Unit::TestCase
d = Dir.tmpdir
assert_in_out_err(["-C", d, "-e", "puts Dir.pwd"]) do |r, e|
- assert_file.identical?(r.join, d)
+ assert_file.identical?(r.join(''), d)
assert_equal([], e)
end
+
+ Dir.mktmpdir(d) do |base|
+ # "test" in Japanese and N'Ko
+ test = base + "/\u{30c6 30b9 30c8}_\u{7e1 7ca 7dd 7cc 7df 7cd 7eb}"
+ Dir.mkdir(test)
+ assert_in_out_err(["-C", base, "-C", File.basename(test), "-e", "puts Dir.pwd"]) do |r, e|
+ assert_file.identical?(r.join(''), test)
+ assert_equal([], e)
+ end
+ Dir.rmdir(test)
+ end
end
def test_yydebug