summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-31 02:32:48 +0000
committerktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-31 02:32:48 +0000
commit70189a8cfd0e06230984b1033635d532c543e39d (patch)
tree3ea652e8dff9c95fb562b3622bc74f7d5882bc86 /test
parent89b601d176a64f1293a3d3b5195b6735cbf880af (diff)
* vm.c: check if cfp is valid. [Bug #5083] [ruby-dev:44208]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_thread.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index daccadde78..c16aa87896 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -604,6 +604,18 @@ class TestThread < Test::Unit::TestCase
end
INPUT
end
+
+ def test_no_valid_cfp
+ bug5083 = '[ruby-dev:44208]'
+ error = assert_raise(RuntimeError) do
+ Thread.new(&Module.method(:nesting)).join
+ end
+ assert_equal("Can't call on top of Fiber or Thread", error.message, bug5083)
+ error = assert_raise(RuntimeError) do
+ Thread.new(:to_s, &Module.method(:undef_method)).join
+ end
+ assert_equal("Can't call on top of Fiber or Thread", error.message, bug5083)
+ end
end
class TestThreadGroup < Test::Unit::TestCase