summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--test/ruby/test_fiber.rb16
2 files changed, 20 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 3df40a85ea..1abeb5e558 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* cont.c (cont_new): add debug message.
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