diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-02 01:37:57 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-02 01:37:57 +0000 |
commit | d42e0ea844b1adbee39bcb8c2266468122670094 (patch) | |
tree | ebe9583357e97266b97f3b7319c2a020c5394f4c /test/ruby/test_symbol.rb | |
parent | 5c58bb9f737e42c9513f5d7f7fe06d6582254c6d (diff) | |
download | ruby-d42e0ea844b1adbee39bcb8c2266468122670094.tar.gz |
parse.y: turn dynamically interned Symbol into an ID
* parse.y (rb_id_attrset): turn dynamically interned Symbol into
an ID, since rb_str_dynamic_intern returns a Symbol but not an
ID. [ruby-core:62226] [Bug #9787]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_symbol.rb')
-rw-r--r-- | test/ruby/test_symbol.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb index e74c41cd2d..686525e053 100644 --- a/test/ruby/test_symbol.rb +++ b/test/ruby/test_symbol.rb @@ -239,8 +239,8 @@ class TestSymbol < Test::Unit::TestCase end def test_gc_attrset - bug9787 = '[ruby-core:62226] [Bug #9787]' - assert_normal_exit(<<-'end;', '', child_env: '--disable-gems') + assert_separately(['-', '[ruby-core:62226] [Bug #9787]'], <<-'end;') # begin + bug = ARGV.shift def noninterned_name(prefix = "") prefix += "_#{Thread.current.object_id.to_s(36).tr('-', '_')}" begin @@ -248,11 +248,13 @@ class TestSymbol < Test::Unit::TestCase end while Symbol.find(name) or Symbol.find(name + "=") name end - n = noninterned_name("gc") - n.to_sym + names = Array.new(1000) {noninterned_name("gc")} + names.each {|n| n.to_sym} GC.start(immediate_sweep: false) - eval(":#{n}=") - eval("proc{self.#{n} = nil}") + names.each do |n| + eval(":#{n}=") + assert_nothing_raised(TypeError, bug) {eval("proc{self.#{n} = nil}")} + end end; end end |