From 3948410b044b80da78d27c622a419d4973a6d8b3 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 1 Jul 2009 07:09:53 +0000 Subject: * 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 --- test/ruby/test_proc.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/ruby') 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 -- cgit v1.2.3