1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/-ext-/symbol/test_inadvertent_creation.rb (noninterned_name):

sigil of global, instance and class variable names should be
  followed by non-numeric.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2011-10-07 11:29:37 +00:00
parent 881891fb2f
commit d5e7b3972c

View file

@ -3,8 +3,8 @@ require "-test-/symbol/symbol"
module Test_Symbol
class TestInadvertent < Test::Unit::TestCase
def noninterned_name(prefix = "_")
prefix += Thread.current.object_id.to_s(36)
def noninterned_name(prefix = "")
prefix += "_#{Thread.current.object_id.to_s(36)}"
begin
name = "#{prefix}_#{rand(0x1000).to_s(16)}_#{Time.now.usec}"
end while Bug::Symbol.interned?(name)