Mercurial > vim
changeset 20168:be661435893a v8.2.0639
patch 8.2.0639: MS-Windows: messages test still fails
Commit: https://github.com/vim/vim/commit/49b2fb36ca94be14b98caf86420863d9bbe81a24
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Apr 25 17:13:56 2020 +0200
patch 8.2.0639: MS-Windows: messages test still fails
Problem: MS-Windows: messages test still fails.
Solution: Filter out the maintainer message.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 25 Apr 2020 17:15:03 +0200 |
parents | 9396041b8f7b |
children | bd970e6fa5d4 |
files | src/testdir/test_messages.vim src/version.c |
diffstat | 2 files changed, 19 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/src/testdir/test_messages.vim +++ b/src/testdir/test_messages.vim @@ -3,21 +3,27 @@ source shared.vim source term_util.vim -function Test_messages() +" Get all messages but drop the maintainer entry. +func GetMessages() + redir => result + redraw | messages + redir END + let msg_list = split(result, "\n") + if msg_list->len() > 0 && msg_list[0] =~ 'Messages maintainer:' + return msg_list[1:] + endif + return msg_list +endfunc + +func Test_messages() let oldmore = &more try set nomore - " Avoid the "message maintainer" line. - let $LANG = '' - let $LC_ALL = '' - let $LC_MESSAGES = '' - let $LC_COLLATE = '' let arr = map(range(10), '"hello" . v:val') for s in arr echomsg s | redraw endfor - let result = '' " get last two messages redir => result @@ -28,24 +34,19 @@ function Test_messages() " clear messages without last one 1messages clear - redir => result - redraw | messages - redir END - let msg_list = split(result, "\n") + let msg_list = GetMessages() call assert_equal(['hello9'], msg_list) " clear all messages messages clear - redir => result - redraw | messages - redir END - call assert_equal('', result) + let msg_list = GetMessages() + call assert_equal([], msg_list) finally let &more = oldmore endtry call assert_fails('message 1', 'E474:') -endfunction +endfunc " Patch 7.4.1696 defined the "clearmode()" function for clearing the mode " indicator (e.g., "-- INSERT --") when ":stopinsert" is invoked. Message