From 6d2dee14f3d5d4224effd0ec2d8fbc07dc54cbac Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 6 Jun 2007 18:30:14 +0000 Subject: * 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 --- test/ruby/test_fiber.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_fiber.rb b/test/ruby/test_fiber.rb index 44caba4520..c99e302b19 100644 --- a/test/ruby/test_fiber.rb +++ b/test/ruby/test_fiber.rb @@ -102,5 +102,21 @@ class TestFiber < Test::Unit::TestCase end.yield } 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 -- cgit v1.2.3