From b07e4af86935780887944432542f0d4b8a2ab62f Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 13 Mar 2018 03:40:10 +0000 Subject: eval_error.c: last newline * eval_error.c (print_errinfo): do not print an empty line at the end when the message ends with a newline. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_exception.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/ruby/test_exception.rb') diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index 6532fecea9..feda30644f 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -1255,12 +1255,12 @@ $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") + 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") + message = message.gsub(/\e\[[\d;]*m/, '') + assert_not_operator(message, :end_with?, "\n\n") end end -- cgit v1.2.3