summaryrefslogtreecommitdiff
path: root/test/psych/test_exception.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2019-01-09 13:34:51 -0800
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-06-25 15:56:20 +0900
commita53ab897c35586a836710a8afeb1e8c1abd9b087 (patch)
tree08a43afe2df4251c3154aa680ecc0c8e33366049 /test/psych/test_exception.rb
parentf770a5be66412fcbdb238db950c80367100a257e (diff)
Round trip exception backtraces
This commit allows exception backtraces to round trip
Diffstat (limited to 'test/psych/test_exception.rb')
-rw-r--r--test/psych/test_exception.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/psych/test_exception.rb b/test/psych/test_exception.rb
index df7fd73740..e7fc88c706 100644
--- a/test/psych/test_exception.rb
+++ b/test/psych/test_exception.rb
@@ -23,6 +23,20 @@ module Psych
$VERBOSE = @orig_verbose
end
+ def make_ex msg = 'oh no!'
+ begin
+ raise msg
+ rescue ::Exception => e
+ e
+ end
+ end
+
+ def test_backtrace
+ err = make_ex
+ new_err = Psych.load(Psych.dump(err))
+ assert_equal err.backtrace, new_err.backtrace
+ end
+
def test_naming_exception
err = String.xxx rescue $!
new_err = Psych.load(Psych.dump(err))