aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_encoding.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_encoding.rb')
-rw-r--r--test/ruby/test_encoding.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_encoding.rb b/test/ruby/test_encoding.rb
index 8034977f93..44419242d2 100644
--- a/test/ruby/test_encoding.rb
+++ b/test/ruby/test_encoding.rb
@@ -1,4 +1,5 @@
require 'test/unit'
+require_relative 'envutil'
class TestEncoding < Test::Unit::TestCase
@@ -39,6 +40,15 @@ class TestEncoding < Test::Unit::TestCase
assert_raise(ArgumentError) { Encoding.find("foobarbazqux") }
assert_nothing_raised{Encoding.find("locale")}
assert_nothing_raised{Encoding.find("filesystem")}
+
+ if /(?:ms|dar)win/ !~ RUBY_PLATFORM
+ # Unix's filesystem encoding is default_external
+ assert_ruby_status(%w[-EUTF-8:EUC-JP], <<-'EOS')
+ exit Encoding.find("filesystem") == Encoding::UTF_8
+ Encoding.default_external = Encoding::EUC_JP
+ exit Encoding.find("filesystem") == Encoding::EUC_JP
+ EOS
+ end
end
def test_dummy_p