ruby-changes:47028
From: ko1 <ko1@a...>
Date: Thu, 22 Jun 2017 17:33:38 +0900 (JST)
Subject: [ruby-changes:47028] ko1:r59143 (trunk): try to fix symbol duplication.
ko1 2017-06-22 17:33:33 +0900 (Thu, 22 Jun 2017) New Revision: 59143 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59143 Log: try to fix symbol duplication. * test/objspace/test_objspace.rb (test_count_symbols): make more complex dynamic symbols to avoid conflict with other existing static symbols. Sometimes this test fails with "mortal_dynamic_symbol=>127". Modified files: trunk/test/objspace/test_objspace.rb Index: test/objspace/test_objspace.rb =================================================================== --- test/objspace/test_objspace.rb (revision 59142) +++ test/objspace/test_objspace.rb (revision 59143) @@ -419,7 +419,7 @@ class TestObjSpace < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/objspace/test_objspace.rb#L419 end def test_count_symbols - syms = (1..128).map{|i| ("xyzzy#{i}" * 128).to_sym} + syms = (1..128).map{|i| ("xyzzy#{i}_#{Process.pid}_#{rand(1_000_000)}_" * 128).to_sym} c = Class.new{define_method(syms[-1]){}} h = ObjectSpace.count_symbols -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/