summaryrefslogtreecommitdiff
path: root/test/ruby/test_string.rb
diff options
context:
space:
mode:
authorcharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-05 04:49:16 +0000
committercharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-05 04:49:16 +0000
commit6fd900007616801f4c8adcc0228fe06bd6f1f873 (patch)
tree56c09166a8ac25e195f9c14f493579a16be90904 /test/ruby/test_string.rb
parent301cb9ca993347ee0f78719f7e01ddb8c16927f5 (diff)
* include/ruby/ruby.h: add RSTRING_FSTR flag
* internal.h: add rb_fstring() prototype * parse.y (str_suffix_gen): deduplicate frozen string literals * string.c (rb_fstring): deduplicate frozen string literals * string.c (rb_str_free): delete fstrings from frozen_strings table when they are GC'd * string.c (Init_String): initialize frozen_strings table * test/ruby/test_string.rb: test frozen strings are deduplicated git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_string.rb')
-rw-r--r--test/ruby/test_string.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index 06a92c59574..1387feccf5e 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -2243,6 +2243,12 @@ class TestString < Test::Unit::TestCase
})
end
end
+
+ def test_frozen_strings_are_deduplicated
+ a = "hello"f
+ b = "hello"f
+ assert_equal a.object_id, b.object_id
+ end
end
class TestString2 < TestString