diff options
Diffstat (limited to 'test/ruby/test_fiber.rb')
-rw-r--r-- | test/ruby/test_fiber.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_fiber.rb b/test/ruby/test_fiber.rb index bf56b2b6d2..536d358dd0 100644 --- a/test/ruby/test_fiber.rb +++ b/test/ruby/test_fiber.rb @@ -164,5 +164,14 @@ class TestFiber < Test::Unit::TestCase assert_equal(nil, Thread.current[:v]); fb.resume assert_equal(nil, Thread.current[:v]); end + + def test_alive + fib = Fiber.new{Fiber.yield} + assert_equal(true, fib.alive?) + fib.resume + assert_equal(true, fib.alive?) + fib.resume + assert_equal(false, fib.alive?) + end end |