summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-13 06:04:25 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-13 06:04:25 +0000
commitc5d7d78daeb44b4c5ad7a9b624638ffd1be96135 (patch)
tree1bf62c0b4a2ddcf40fd9300c0e0922f036b2dad5 /test
parent03ee5fa027616680d74717d74bf3f53b6aacfc9a (diff)
* cont.c (rb_fiber_alive_p): fix to return true instead of 1.
[ruby-dev:37991] * test/ruby/test_fiber.rb: add a test for Fiber#alive? git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_fiber.rb9
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