From bc3db2a512b3aba51a49de29dd5165d619fe09a1 Mon Sep 17 00:00:00 2001 From: tarui Date: Sat, 16 Nov 2013 00:24:39 +0000 Subject: * test/ruby/test_hash.rb (class TestHash): add tests for [ruby-dev:47803] [Bug #9105] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_hash.rb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'test/ruby/test_hash.rb') diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb index 4da8e234de..c8cf5c6fbf 100644 --- a/test/ruby/test_hash.rb +++ b/test/ruby/test_hash.rb @@ -950,6 +950,37 @@ class TestHash < Test::Unit::TestCase 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] -- cgit v1.2.3