summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-16 09:28:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-16 09:28:12 +0000
commit415d5ebc2f96e04fea438cd86ad23aa94a0e1da2 (patch)
tree8c075abf8217608de305500a5276244d4abe58f9 /test
parentfa41dad1b2ae2bdf58bff62dac561362cf81ab49 (diff)
* id.c (Init_id), vm.c (vm_exec): @#__ThrowState__ is no longer
used. [ruby-dev:38760] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_exception.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index cba88f5c90..1eaeb7b3fb 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