mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
6e3184e25a
commit
bc3db2a512
1 changed files with 31 additions and 0 deletions
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue