summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-01 07:09:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-01 07:09:53 +0000
commit3948410b044b80da78d27c622a419d4973a6d8b3 (patch)
tree792cb4cc33bc3a4b34c7aba5b4185211fc9f007f /test/ruby
parentb8d684d9e2cfb7e4744fa3c2c283007ce26bd7a0 (diff)
* test/ruby/test_proc.rb (test_return_from_proc): test for [ruby-core:24097].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_proc.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb
index 5436879041..c0a4e2268c 100644
--- a/test/ruby/test_proc.rb
+++ b/test/ruby/test_proc.rb
@@ -101,4 +101,11 @@ class TestProc < Test::Unit::TestCase
c.new.x(nil)
assert_equal(2, a, '[ruby-core:23050]')
end
+
+ def given_block(&b) b end
+ def test_return_from_proc
+ a_proc = eval("Proc.new { return }", TOPLEVEL_BINDING)
+ res = given_block(&a_proc)
+ assert_raise(LocalJumpError, '[ruby-core:24097]') {res.call}
+ end
end