From 98a74d4dd5fa9cd45121e8ebfc2f787d316e924f Mon Sep 17 00:00:00 2001 From: tmm1 Date: Sun, 8 Dec 2013 01:39:27 +0000 Subject: parse.y: use rb_fstring() for strings stored in the symbol table * parse.y (register_symid_str): use fstrings in symbol table [Bug #9171] [ruby-core:58656] * parse.y (rb_id2str): ditto * string.c (rb_fstring): create frozen_strings on first usage. this allows rb_fstring() calls from the parser (before cString is created) * string.c (fstring_set_class_i): set klass on fstrings generated before cString was defined * string.c (Init_String): convert frozen_strings table to String objects after boot * ext/-test-/symbol/type.c (bug_sym_id2str): expose rb_id2str() * test/-ext-/symbol/test_type.rb (module Test_Symbol): verify symbol table entries are fstrings git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/-ext-/symbol/test_type.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/-ext-/symbol/test_type.rb b/test/-ext-/symbol/test_type.rb index d6816754c8..9053d936e2 100644 --- a/test/-ext-/symbol/test_type.rb +++ b/test/-ext-/symbol/test_type.rb @@ -3,6 +3,16 @@ require "-test-/symbol" module Test_Symbol class TestType < Test::Unit::TestCase + def test_id2str_fstring_bug9171 + fstr = eval("# encoding: us-ascii + 'foobar'.freeze") + assert_same fstr, Bug::Symbol.id2str(:foobar) + + fstr = eval("# encoding: us-ascii + '>'.freeze") + assert_same fstr, Bug::Symbol.id2str(:>) + end + def assert_symtype(sym, pred, msg = nil) assert_send([Bug::Symbol, pred, sym], msg) end -- cgit v1.2.3