summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_string.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index 0c75f31311..892aa2335d 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -1897,6 +1897,14 @@ class TestString < Test::Unit::TestCase
assert_equal('"\\u3042\\u3044\\u3046"', "\u3042\u3044\u3046".encode(e).inspect)
assert_equal('"ab\\"c"', "ab\"c".encode(e).inspect, bug4081)
end
+ begin
+ ext = Encoding.default_external
+ Encoding.default_external = "us-ascii"
+ i = "abc\"\\".force_encoding("utf-8").inspect
+ ensure
+ Encoding.default_external = ext
+ end
+ assert_equal('"abc\\"\\\\"', i, bug4081)
end
def test_prepend