summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-16 00:24:39 +0000
committertarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-16 00:24:39 +0000
commitbc3db2a512b3aba51a49de29dd5165d619fe09a1 (patch)
tree8dec2a74dc376410bbe3095db0f13db893440aa3
parent6e3184e25a8294e25214faebec4b072b64ab15cb (diff)
* 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
-rw-r--r--test/ruby/test_hash.rb31
1 files changed, 31 insertions, 0 deletions
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]