mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
2c0d3e2a2e
* test/-ext-/symbol/noninterned_name.rb: split from test_inadvertent_creation.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
15 lines
342 B
Ruby
15 lines
342 B
Ruby
require "-test-/symbol"
|
|
|
|
module Test_Symbol
|
|
module NonInterned
|
|
module_function
|
|
|
|
def noninterned_name(prefix = "")
|
|
prefix += "_#{Thread.current.object_id.to_s(36).tr('-', '_')}"
|
|
begin
|
|
name = "#{prefix}_#{rand(0x1000).to_s(16)}_#{Time.now.usec}"
|
|
end while Bug::Symbol.find(name)
|
|
name
|
|
end
|
|
end
|
|
end
|