mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
On some platforms, object_id can be negative value like NetBSD.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5dbc3d1e79
commit
632f448827
1 changed files with 1 additions and 1 deletions
|
@ -4,7 +4,7 @@ require "-test-/symbol/symbol"
|
||||||
module Test_Symbol
|
module Test_Symbol
|
||||||
class TestInadvertent < Test::Unit::TestCase
|
class TestInadvertent < Test::Unit::TestCase
|
||||||
def noninterned_name(prefix = "")
|
def noninterned_name(prefix = "")
|
||||||
prefix += "_#{Thread.current.object_id.to_s(36)}"
|
prefix += "_#{Thread.current.object_id.to_s(36).tr('-', '_')}"
|
||||||
begin
|
begin
|
||||||
name = "#{prefix}_#{rand(0x1000).to_s(16)}_#{Time.now.usec}"
|
name = "#{prefix}_#{rand(0x1000).to_s(16)}_#{Time.now.usec}"
|
||||||
end while Bug::Symbol.interned?(name)
|
end while Bug::Symbol.interned?(name)
|
||||||
|
|
Loading…
Reference in a new issue