summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-01 08:50:55 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-01 08:50:55 +0000
commit418c1375fb74edd253c9d5769a7a02245d432379 (patch)
treec44b2bdef4eae5f740b0712bc067234448479020 /test
parent8717a9ec861ac129d3c93f8eb44e8c3ef07ed9af (diff)
test_rubyoptions.rb: locale name
* test/ruby/test_rubyoptions.rb: try locale encoding name. [ruby-core:67109] [Bug #10643] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_rubyoptions.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index 8d3da54997..208f480c20 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -712,8 +712,15 @@ class TestRubyOptions < Test::Unit::TestCase
def test_command_line_progname_nonascii
bug10555 = '[ruby-dev:48752] [Bug #10555]'
- name = "\u{3042}.rb"
- expected = name.encode("locale") rescue "?.rb"
+ name = expected = nil
+ unless (0x80..0x10000).any? {|c|
+ name = c.chr(Encoding::UTF_8)
+ expected = name.encode("locale") rescue nil
+ }
+ skip "can't make locale name"
+ end
+ name << ".rb"
+ expected << ".rb"
with_tmpchdir do |dir|
open(name, "w") {|f| f.puts "puts File.basename($0)"}
assert_in_out_err([name], "", [expected], [],