summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-20 08:14:11 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-20 08:14:11 +0000
commitf869ed2ff334c78d21aaebf7c359df80593e358c (patch)
tree321ff58662f295b9a171f21a4b3e43c4814d8ada /test
parentb800677425e0839eac1014d0a2fe9201cabe3a18 (diff)
merge revision(s) 33991:
* file.c (file_path_convert): don't convert it when the path string is ascii only. [ruby-core:41556] [Bug #5733] tests are contributed by nobu. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@36735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_econv.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb
index 080d027c4a..f667d733a0 100644
--- a/test/ruby/test_econv.rb
+++ b/test/ruby/test_econv.rb
@@ -1,4 +1,5 @@
require 'test/unit'
+require 'envutil'
class TestEncodingConverter < Test::Unit::TestCase
def check_ec(edst, esrc, eres, dst, src, ec, off, len, opts=nil)
@@ -908,4 +909,23 @@ class TestEncodingConverter < Test::Unit::TestCase
ec2 = Encoding::Converter.new("", "", newline: :universal)
assert_equal(ec1, ec2)
end
+
+ def test_default_external
+ cmd = <<EOS
+ Encoding.default_external = ext = ARGV[0]
+ Encoding.default_internal = int ='utf-8'
+ begin
+ Encoding::Converter.new(ext, int)
+ ensure
+ Marshal.dump($!, STDOUT)
+ STDOUT.flush
+ end
+EOS
+ Encoding.list.grep(->(enc) {/^ISO-8859-\d(?:[0-5])?\z/i =~ enc.name}) do |enc|
+ error = IO.popen([EnvUtil.rubybin, "-e", cmd, enc.name]) do |child|
+ Marshal.load(child)
+ end
+ assert_nil(error)
+ end
+ end
end