diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | test/ruby/test_fiber.rb | 12 |
2 files changed, 18 insertions, 0 deletions
@@ -1,3 +1,9 @@ +Sun Sep 4 00:47:39 2011 Kazuki Tsujimoto <kazuki@callcc.net> + + * test/ruby/test_fiber.rb (TestFiber#test_no_valid_cfp): + add a test. Unlike TestThread#test_no_valid_cfp, + this test succeeds even if win32ole is required (see r33153). + Sun Sep 4 00:11:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org> * variable.c (rb_const_set): show the previous definition diff --git a/test/ruby/test_fiber.rb b/test/ruby/test_fiber.rb index e3e40566f8..ed7ecc71ae 100644 --- a/test/ruby/test_fiber.rb +++ b/test/ruby/test_fiber.rb @@ -208,5 +208,17 @@ class TestFiber < Test::Unit::TestCase GC.start }, bug4612 end + + def test_no_valid_cfp + bug5083 = '[ruby-dev:44208]' + error = assert_raise(RuntimeError) do + Fiber.new(&Module.method(:nesting)).resume + end + assert_equal("Can't call on top of Fiber or Thread", error.message, bug5083) + error = assert_raise(RuntimeError) do + Fiber.new(&Module.method(:undef_method)).resume(:to_s) + end + assert_equal("Can't call on top of Fiber or Thread", error.message, bug5083) + end end |