diff options
author | Lars Kanis <kanis@comcard.de> | 2020-01-27 13:15:46 +0100 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-02-04 08:24:59 +0900 |
commit | 7a51d979cf9c98209b7c1b1d54016348e8124904 (patch) | |
tree | ef6a5f285f11c08aadc20adabd5c3ab8f0323338 /test/ruby/test_rubyoptions.rb | |
parent | 7c165bd7d9451cc5c9fc833807ca071d7012e138 (diff) |
Fix inaccuracy in encoding tests
These tests assume
Encoding.find('locale') == Encoding.find('external')
and fail if they are distinct.
Diffstat (limited to 'test/ruby/test_rubyoptions.rb')
-rw-r--r-- | test/ruby/test_rubyoptions.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 0aa253a74f..890f4c9b4e 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -285,7 +285,7 @@ class TestRubyOptions < Test::Unit::TestCase /unknown encoding name - test_ruby_test_rubyoptions_foobarbazqux \(RuntimeError\)/) if /mswin|mingw|aix|android/ =~ RUBY_PLATFORM && - (str = "\u3042".force_encoding(Encoding.find("locale"))).valid_encoding? + (str = "\u3042".force_encoding(Encoding.find("external"))).valid_encoding? # This result depends on locale because LANG=C doesn't affect locale # on Windows. # On AIX, the source encoding of stdin with LANG=C is ISO-8859-1, @@ -838,11 +838,11 @@ class TestRubyOptions < Test::Unit::TestCase def test_command_line_glob_nonascii bug10555 = '[ruby-dev:48752] [Bug #10555]' name = "\u{3042}.txt" - expected = name.encode("locale") rescue "?.txt" + expected = name.encode("external") rescue "?.txt" with_tmpchdir do |dir| open(name, "w") {} assert_in_out_err(["-e", "puts ARGV", "?.txt"], "", [expected], [], - bug10555, encoding: "locale") + bug10555, encoding: "external") end end @@ -877,7 +877,7 @@ class TestRubyOptions < Test::Unit::TestCase with_tmpchdir do |dir| Ougai.each {|f| open(f, "w") {}} assert_in_out_err(["-Eutf-8", "-e", "puts ARGV", "*"], "", Ougai, encoding: "utf-8") - ougai = Ougai.map {|f| f.encode("locale", replace: "?")} + ougai = Ougai.map {|f| f.encode("external", replace: "?")} assert_in_out_err(["-e", "puts ARGV", "*.txt"], "", ougai) end end |