aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_string.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index 1387feccf5..4520464105 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -2249,6 +2249,13 @@ class TestString < Test::Unit::TestCase
b = "hello"f
assert_equal a.object_id, b.object_id
end
+
+ def test_frozen_strings_are_deduplicated_with_encoding
+ a = eval("# coding: utf-8\n'hello'f")
+ b = eval("# coding: ascii\n'hello'f")
+ assert_equal Encoding::UTF_8, a.encoding
+ assert_equal Encoding::US_ASCII, b.encoding
+ end
end
class TestString2 < TestString