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:
parent
881891fb2f
commit
d5e7b3972c
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue