summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-26 04:21:14 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-26 04:21:14 +0000
commited03c4d8d53aae6afc02fb230a4ff294662df6e8 (patch)
treeff179555dca38702f2ac21605993b5fab88449da /test
parentba1bd67dbecb5922a28ef61df98e1a09a234dc1b (diff)
merge revision(s) 54720: [Backport #12184]
* ruby.c: cygwin does not use w32_cmdvector, command line can be other than UTF-8. [ruby-dev:49519] [Bug #12184] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@54770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_rubyoptions.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index 7cb1248e53..d3ac0bc0cf 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -698,7 +698,8 @@ class TestRubyOptions < Test::Unit::TestCase
end
end
- if /mswin|mingw/ =~ RUBY_PLATFORM
+ case RUBY_PLATFORM
+ when /mswin|mingw/
def test_command_line_glob_nonascii
bug10555 = '[ruby-dev:48752] [Bug #10555]'
name = "\u{3042}.txt"
@@ -728,9 +729,7 @@ class TestRubyOptions < Test::Unit::TestCase
assert_in_out_err(["-e", "", "test/*"], "", [], [], bug10941)
end
end
- end
- if /mswin|mingw/ =~ RUBY_PLATFORM
Ougai = %W[\u{68ee}O\u{5916}.txt \u{68ee 9d0e 5916}.txt \u{68ee 9dd7 5916}.txt]
def test_command_line_glob_noncodepage
with_tmpchdir do |dir|
@@ -740,6 +739,14 @@ class TestRubyOptions < Test::Unit::TestCase
assert_in_out_err(["-e", "puts ARGV", "*.txt"], "", ougai)
end
end
+ when /cygwin/
+ def test_command_line_non_ascii
+ assert_separately([{"LC_ALL"=>"ja_JP.SJIS"}, "-", "\u{3042}".encode("SJIS")], <<-"end;")
+ bug12184 = '[ruby-dev:49519] [Bug #12184]'
+ a = ARGV[0]
+ assert_equal([Encoding::SJIS, 130, 160], [a.encoding, *a.bytes], bug12184)
+ end;
+ end
end
def test_script_is_directory