eval_error.c: reset in each line

* eval_error.c (print_errinfo): reset in each line, so that
  Exception#full_message ends with a newline and puts will not
  print an extra newline.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-01-07 05:38:37 +00:00
parent ac4d348d45
commit 89f0419575
2 changed files with 27 additions and 7 deletions

View file

@ -1113,6 +1113,9 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
end
def test_full_message
message = RuntimeError.new("testerror").full_message
assert_operator(message, :end_with?, "\n")
test_method = "def foo; raise 'testerror'; end"
out1, err1, status1 = EnvUtil.invoke_ruby(['-e', "#{test_method}; begin; foo; rescue => e; puts e.full_message; end"], '', true, true)