diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-13 03:40:10 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-13 03:40:10 +0000 |
commit | b07e4af86935780887944432542f0d4b8a2ab62f (patch) | |
tree | 9018cd82b319ba0cd83a1c14bb10e778bca9e654 /test/ruby/test_exception.rb | |
parent | e537dc331ef0c3b4a5db9b9124ba750f6ddb6eb2 (diff) |
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
Diffstat (limited to 'test/ruby/test_exception.rb')
-rw-r--r-- | test/ruby/test_exception.rb | 12 |
1 files changed, 6 insertions, 6 deletions
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 |