From 89f041957548302af46d71e3c97fa58415677c8a Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 7 Jan 2018 05:38:37 +0000 Subject: 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 --- test/ruby/test_exception.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index 386d736d16..98462bef93 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -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) -- cgit v1.2.3