diff options
| author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-06 18:30:14 +0000 |
|---|---|---|
| committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-06 18:30:14 +0000 |
| commit | b81063497c0411050a4495afe87a9c8f7a0da82c (patch) | |
| tree | 878aeb1d2747c235977b20e13ebb79bcf94991f0 /test/ruby | |
| parent | cef7000d1ba44fd0fee546cee9c69425e4147b5e (diff) | |
| download | ruby-b81063497c0411050a4495afe87a9c8f7a0da82c.tar.gz ruby-b81063497c0411050a4495afe87a9c8f7a0da82c.tar.xz ruby-b81063497c0411050a4495afe87a9c8f7a0da82c.zip | |
* test_fiber.rb: add a test (Continuation and Fiber).
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_fiber.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_fiber.rb b/test/ruby/test_fiber.rb index 44caba452..c99e302b1 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 |
