summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-12 13:04:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-12 13:04:28 +0000
commit2851b2c55f54b651f250525528c57868e419baa1 (patch)
tree6b28f45baa795ef77582275388113ab22766f792 /test/ruby
parent7773cfa496fe04b4d4712beddfdcca3c052ee153 (diff)
eval_error.c: fix underflow
* eval_error.c (print_errinfo): get rid of negative string length. [ruby-core:86086] [Bug #14598] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_exception.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index bb70bf508f..6532fecea9 100644
--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -1254,5 +1254,13 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
_, err2, status1 = EnvUtil.invoke_ruby(['-e', "#{test_method}; begin; foo; end"], '', true, true)
assert_equal(err2, out1)
+
+ if $stderr.tty?
+ e = RuntimeError.new("a\n")
+ message = assert_nothing_raised(ArgumentError, proc {e.pretty_inspect}) do
+ e.full_message
+ end
+ assert_operator(message, :end_with?, "\n")
+ end
end
end