summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-26 04:17:39 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-26 04:17:39 +0000
commitba1bd67dbecb5922a28ef61df98e1a09a234dc1b (patch)
tree759baf87ef846dcd090971a59372da3581442edd /test
parented01f3c71eb32a73f062fbd8b6db01ba41d952f4 (diff)
merge revision(s) 54681: [Backport #12302]
* eval_jump.c (exec_end_procs_chain): restore previous error info for each end procs. [ruby-core:75038] [Bug #12302] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@54769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_beginendblock.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_beginendblock.rb b/test/ruby/test_beginendblock.rb
index 9c9d6b5e61..85298eaa92 100644
--- a/test/ruby/test_beginendblock.rb
+++ b/test/ruby/test_beginendblock.rb
@@ -187,4 +187,22 @@ at_exit { callcc {|_c| c = _c } }
EOS
assert_normal_exit(script, bug9110)
end
+
+ def test_errinfo_at_exit
+ bug12302 = '[ruby-core:75038] [Bug #12302]'
+ assert_in_out_err([], <<-'end;', %w[2:exit 1:exit], [], bug12302)
+ at_exit do
+ puts "1:#{$!}"
+ end
+
+ at_exit do
+ puts "2:#{$!}"
+ raise 'x' rescue nil
+ end
+
+ at_exit do
+ exit
+ end
+ end;
+ end
end