mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
Prohibit circular causes [Bug #15447]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
71e458023d
commit
d397c89f88
2 changed files with 17 additions and 5 deletions
|
@ -1352,14 +1352,11 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
|
|||
end
|
||||
|
||||
def test_circular_cause_handle
|
||||
errs = [/.*error 1.*\n/, /.*error 2.*\n/, /.*error 1.*/m]
|
||||
assert_in_out_err([], "#{<<~"begin;"}\n#{<<~'end;'}", [], errs, success: false, timeout: 2)
|
||||
begin;
|
||||
assert_raise_with_message(ArgumentError, /circular cause/) do
|
||||
begin
|
||||
raise "error 1"
|
||||
rescue => e1
|
||||
raise "error 2" rescue e2 = $!
|
||||
raise e1, cause: e2
|
||||
raise "error 2" rescue raise e1, cause: $!
|
||||
end
|
||||
end;
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue