ruby-changes:45120
From: nobu <ko1@a...>
Date: Mon, 26 Dec 2016 19:00:38 +0900 (JST)
Subject: [ruby-changes:45120] nobu:r57193 (trunk): test/ruby/test_symbol.rb: use begin; end; hack
nobu 2016-12-26 19:00:34 +0900 (Mon, 26 Dec 2016) New Revision: 57193 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57193 Log: test/ruby/test_symbol.rb: use begin;end; hack Modified files: trunk/test/ruby/test_symbol.rb Index: test/ruby/test_symbol.rb =================================================================== --- test/ruby/test_symbol.rb (revision 57192) +++ test/ruby/test_symbol.rb (revision 57193) @@ -121,21 +121,24 @@ class TestSymbol < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_symbol.rb#L121 end def test_to_proc_yield - assert_ruby_status([], <<-"end;", timeout: 5.0) + assert_ruby_status([], "#{<<-"begin;"}\n#{<<-"end;"}", timeout: 5.0) + begin; GC.stress = true true.tap(&:itself) end; end def test_to_proc_new_proc - assert_ruby_status([], <<-"end;", timeout: 5.0) + assert_ruby_status([], "#{<<-"begin;"}\n#{<<-"end;"}", timeout: 5.0) + begin; GC.stress = true 2.times {Proc.new(&:itself)} end; end def test_to_proc_no_method - assert_separately([], <<-"end;", timeout: 5.0) + assert_separately([], "#{<<-"begin;"}\n#{<<-"end;"}", timeout: 5.0) + begin; bug11566 = '[ruby-core:70980] [Bug #11566]' assert_raise(NoMethodError, bug11566) {Proc.new(&:foo).(1)} assert_raise(NoMethodError, bug11566) {:foo.to_proc.(1)} @@ -143,7 +146,8 @@ class TestSymbol < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_symbol.rb#L146 end def test_to_proc_arg - assert_separately([], <<-"end;", timeout: 5.0) + assert_separately([], "#{<<-"begin;"}\n#{<<-"end;"}", timeout: 5.0) + begin; def (obj = Object.new).proc(&b) b; end assert_same(:itself.to_proc, obj.proc(&:itself)) end; @@ -168,13 +172,15 @@ class TestSymbol < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_symbol.rb#L172 def test_to_proc_for_hash_each bug11830 = '[ruby-core:72205] [Bug #11830]' - assert_normal_exit(<<-'end;', bug11830) # do + assert_normal_exit("#{<<-"begin;"}\n#{<<-'end;'}", bug11830) + begin; {}.each(&:destroy) end; end def test_to_proc_iseq - assert_separately([], <<~"end;", timeout: 5) # do + assert_separately([], "#{<<-"begin;"}\n#{<<~"end;"}", timeout: 5) + begin; bug11845 = '[ruby-core:72381] [Bug #11845]' assert_nil(:class.to_proc.source_location, bug11845) assert_equal([[:rest]], :class.to_proc.parameters, bug11845) @@ -186,7 +192,8 @@ class TestSymbol < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_symbol.rb#L192 end def test_to_proc_binding - assert_separately([], <<~"end;", timeout: 5) # do + assert_separately([], "#{<<-"begin;"}\n#{<<~"end;"}", timeout: 5) + begin; bug12137 = '[ruby-core:74100] [Bug #12137]' assert_raise(ArgumentError, bug12137) { :succ.to_proc.binding @@ -454,13 +461,15 @@ class TestSymbol < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_symbol.rb#L461 def test_symbol_fstr_leak bug10686 = '[ruby-core:67268] [Bug #10686]' x = x = 0 - assert_no_memory_leak([], '200_000.times { |i| i.to_s.to_sym }; GC.start', <<-"end;", bug10686, limit: 1.71, rss: true, timeout: 20) + assert_no_memory_leak([], '200_000.times { |i| i.to_s.to_sym }; GC.start', "#{<<-"begin;"}\n#{<<-"end;"}", bug10686, limit: 1.71, rss: true, timeout: 20) + begin; 200_000.times { |i| (i + 200_000).to_s.to_sym } end; end def test_hash_redefinition - assert_separately([], <<-'end;') + assert_separately([], "#{<<-"begin;"}\n#{<<-'end;'}") + begin; bug11035 = '[ruby-core:68767] [Bug #11035]' class Symbol def hash -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/