summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-21 11:44:21 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-21 11:44:21 +0000
commit010a742cb6772d4a27d5fee3606ac9385ca246e0 (patch)
tree164cee8955a2c021286827b5a9475007252dd430 /test
parent09b3d38c724f8e12efe69ea5ee0942335b100764 (diff)
downloadruby-010a742cb6772d4a27d5fee3606ac9385ca246e0.tar.gz
eval_error.c (show_cause): check if cause is an Exception or not
Fixes [Bug #15447] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_exception.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index 3582cb3de3..88bd095228 100644
--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -1341,6 +1341,15 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
assert_in_out_err([], code, [], /Bug14566/, success: false, timeout: 2)
end
+ def test_non_exception_cause
+ puts "foo"
+ code = "#{<<~"begin;"}\n#{<<~'end;'}"
+ begin;
+ raise "foo", cause: 1
+ end;
+ assert_in_out_err([], code, [], /foo/, success: false, timeout: 2)
+ end
+
def test_super_in_method_missing
assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
begin;