diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-05 17:55:07 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-05 17:55:07 +0000 |
commit | 64ffdb44402f365198ba45c84fa15e449f3411e6 (patch) | |
tree | 3bae79f13e9ed13a7c528aacfffb8e4e114d1c32 /test/ruby/test_fiber.rb | |
parent | 5f05c269e943b7c633f999b5f046122ba39559fa (diff) | |
download | ruby-64ffdb44402f365198ba45c84fa15e449f3411e6.tar.gz |
* cont.c (rb_fiber_start): clear th->tag and check error to fix
[ruby-dev:30888] and [ruby-dev:30889].
* eval_intern.h: fix rb_fiber_start() prototype.
* test/ruby/test_fiber.rb: add tests for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_fiber.rb')
-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 999bfd267a..97ec09c36b 100644 --- a/test/ruby/test_fiber.rb +++ b/test/ruby/test_fiber.rb @@ -69,5 +69,21 @@ class TestFiber < Test::Unit::TestCase assert_equal(:ok, f1.yield) assert_equal([:baz, :bar], ary) end + + def test_return + assert_raise(LocalJumpError){ + Fiber.new do + return + end.yield + } + end + + def test_throw + assert_raise(RuntimeError){ + Fiber.new do + throw :a + end.yield + } + end end |