diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-22 06:09:29 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-22 06:09:29 +0000 |
commit | d76a58abd0c75697d6a39a9b9c06449f3630ef9b (patch) | |
tree | a36b96a84d8670d977c545539deabd08e27890bd /test | |
parent | f74d0173f9a8893e29eb58a0c110a40223c62c69 (diff) | |
download | ruby-d76a58abd0c75697d6a39a9b9c06449f3630ef9b.tar.gz |
eval_jump.c: restore previous error info
* 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/trunk@54681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_beginendblock.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_beginendblock.rb b/test/ruby/test_beginendblock.rb index 0c88e9eb23..a09c963b3c 100644 --- a/test/ruby/test_beginendblock.rb +++ b/test/ruby/test_beginendblock.rb @@ -130,4 +130,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 |