summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_exception.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index b2f6bf07ea..0f2511a386 100644
--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -1353,6 +1353,19 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
assert_in_out_err([], code, [], /foo/, success: false, timeout: 2)
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;
+ begin
+ raise "error 1"
+ rescue => e1
+ raise "error 2" rescue e2 = $!
+ raise e1, cause: e2
+ end
+ end;
+ end
+
def test_super_in_method_missing
assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
begin;