ruby-changes:31613
From: tarui <ko1@a...>
Date: Sat, 16 Nov 2013 09:24:45 +0900 (JST)
Subject: [ruby-changes:31613] tarui:r43692 (trunk): * test/ruby/test_hash.rb (class TestHash): add tests for [Bug #9105]
tarui 2013-11-16 09:24:39 +0900 (Sat, 16 Nov 2013) New Revision: 43692 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43692 Log: * test/ruby/test_hash.rb (class TestHash): add tests for [ruby-dev:47803] [Bug #9105] Modified files: trunk/test/ruby/test_hash.rb Index: test/ruby/test_hash.rb =================================================================== --- test/ruby/test_hash.rb (revision 43691) +++ test/ruby/test_hash.rb (revision 43692) @@ -950,6 +950,37 @@ class TestHash < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_hash.rb#L950 end end + def test_callcc_escape + bug9105 = '[ruby-dev:47803] [Bug #9105]' + assert_nothing_raised(RuntimeError, bug9105) do + h=@cls[] + cnt=0 + c = callcc {|c|c} + h[cnt] = true + h.each{|i| + cnt+=1 + c.call if cnt == 1 + } + end + end + + def test_callcc_reenter + bug9105 = '[ruby-dev:47803] [Bug #9105]' + assert_nothing_raised(RuntimeError, bug9105) do + h = @cls[1=>2,3=>4] + c = nil + f = false + h.each { |i| + callcc {|c2| c = c2 } unless c + h.delete(1) if f + } + unless f + f = true + c.call + end + end + end + def test_threaded_iter_level bug9105 = '[ruby-dev:47807] [Bug #9105]' h = @cls[1=>2] -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/