aboutsummaryrefslogtreecommitdiffstats
path: root/test/-ext-/symbol/noninterned_name.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-12 08:16:58 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-12 08:16:58 +0000
commit2c0d3e2a2e134a345a83ccd9a9e70af77ac4963f (patch)
tree728e2a96d192e4ee2a67dc2a345644cd98356b60 /test/-ext-/symbol/noninterned_name.rb
parent04e83c536e544a73a19799b4a59c736861c23f51 (diff)
downloadruby-2c0d3e2a2e134a345a83ccd9a9e70af77ac4963f.tar.gz
symbol/noninterned_name.rb
* 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
Diffstat (limited to 'test/-ext-/symbol/noninterned_name.rb')
-rw-r--r--test/-ext-/symbol/noninterned_name.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/-ext-/symbol/noninterned_name.rb b/test/-ext-/symbol/noninterned_name.rb
new file mode 100644
index 0000000000..7c9097ae25
--- /dev/null
+++ b/test/-ext-/symbol/noninterned_name.rb
@@ -0,0 +1,15 @@
+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