summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-22 02:28:10 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-22 02:28:10 +0000
commit85ddcb935791939d107cf11db7b3839f82b95cb0 (patch)
treecee3fc46b268f02e2b737427986ffae8b0e241d3 /test
parent9852802c887b1457dbff4f83e341b768fbfe6a5d (diff)
merge revision(s) 54737,54740,55792: [Backport #14623]
Support MSVC14 and 15 [Bug #11118] Search _pioinfo which is not exported after MSVC14. [Bug #12014] [GH-884] win32.c: suppress warnings * win32/win32.c (set_pioinfo_extra): remove "/*" within comment. * win32/win32.c (set_pioinfo_extra): use more reliable way to search the position of pioinfo of VC14, and also support debug library of it. patched by davispuh AT gmail.com [ruby-core:76644] [Bug #12644] this fixes also [Bug #12631] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@62884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/-ext-/symbol/noninterned_name.rb15
-rw-r--r--test/-ext-/symbol/test_inadvertent_creation.rb23
2 files changed, 21 insertions, 17 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
diff --git a/test/-ext-/symbol/test_inadvertent_creation.rb b/test/-ext-/symbol/test_inadvertent_creation.rb
index 5d3906a40b..a923340828 100644
--- a/test/-ext-/symbol/test_inadvertent_creation.rb
+++ b/test/-ext-/symbol/test_inadvertent_creation.rb
@@ -1,16 +1,10 @@
# frozen_string_literal: false
require 'test/unit'
-require "-test-/symbol"
+require_relative 'noninterned_name'
module Test_Symbol
class TestInadvertent < Test::Unit::TestCase
- 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
+ include NonInterned
def setup
@obj = Object.new
@@ -362,15 +356,9 @@ module Test_Symbol
end
def test_gc_attrset
- assert_separately(['-r-test-/symbol', '-', '[ruby-core:62226] [Bug #9787]'], <<-'end;') # begin
- bug = ARGV.shift
- 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) or Bug::Symbol.find(name + "=")
- name
- end
+ assert_separately(['-r-test-/symbol', '-r-ext-/symbol/noninterned_name', '-'], "#{<<-'begin;'}\n#{<<-"end;"}")
+ bug = '[ruby-core:62226] [Bug #9787]'
+ include Test_Symbol::NonInterned
names = Array.new(1000) {noninterned_name("gc")}
names.each {|n| n.to_sym}
GC.start(immediate_sweep: false)
@@ -378,6 +366,7 @@ module Test_Symbol
eval(":#{n}=")
assert_nothing_raised(TypeError, bug) {eval("proc{self.#{n} = nil}")}
end
+ begin;
end;
end