From ef4f7cd0e28f546a0f685e07b4eec0c631a491ff Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 16 Jul 2009 09:28:12 +0000 Subject: * id.c (Init_id), vm.c (vm_exec): @#__ThrowState__ is no longer used. [ruby-dev:38760] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_exception.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index cba88f5c9..1eaeb7b3f 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -223,4 +223,23 @@ class TestException < Test::Unit::TestCase end INPUT end + + def test_safe4 + cmd = proc{raise SystemExit} + safe0_p = proc{|*args| args} + + test_proc = proc { + $SAFE = 4 + begin + cmd.call + rescue SystemExit => e + safe0_p["SystemExit: #{e.inspect}"] + raise e + rescue Exception => e + safe0_p["Exception (NOT SystemExit): #{e.inspect}"] + raise e + end + } + assert_raise(SystemExit, '[ruby-dev:38760]') {test_proc.call} + end end -- cgit