Commit 406e089a authored by Carson McDonald's avatar Carson McDonald

Add test for raise on resume after fiber is dead

parent 8487ab06
...@@ -40,3 +40,17 @@ assert('Fiber iteration') { ...@@ -40,3 +40,17 @@ assert('Fiber iteration') {
assert('Fiber with splat in the block argument list') { assert('Fiber with splat in the block argument list') {
Fiber.new{|*x|x}.resume(1) == [1] Fiber.new{|*x|x}.resume(1) == [1]
} }
assert('Fiber raises on resume when dead') {
e2 = nil
r1 = true
begin
f = Fiber.new{}
f.resume
r1 = f.alive?
f.resume
rescue => e1
e2 = e1
end
r1 == false and e2.class == RuntimeError
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment