1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test_fiber.rb: add a test (Continuation and Fiber).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2007-06-06 18:30:14 +00:00
parent d80e7373cf
commit 6d2dee14f3
2 changed files with 20 additions and 0 deletions

View file

@ -1,3 +1,7 @@
Thu Jun 7 03:29:18 2007 Koichi Sasada <ko1@atdot.net>
* test_fiber.rb: add a test (Continuation and Fiber).
Thu Jun 7 03:17:24 2007 Koichi Sasada <ko1@atdot.net> Thu Jun 7 03:17:24 2007 Koichi Sasada <ko1@atdot.net>
* cont.c (cont_new): add debug message. * cont.c (cont_new): add debug message.

View file

@ -102,5 +102,21 @@ class TestFiber < Test::Unit::TestCase
end.yield end.yield
} }
end end
def test_with_callcc
c = nil
f1 = f2 = nil
f1 = Fiber.new do
callcc do |c2|
c = c2
f2.yield
end
:ok
end
f2 = Fiber.new do
c.call
end
assert_equal(f1.yield, :ok)
end
end end