[vim] 53/139: patch 7.4.1739 Problem: Messages test fails on MS-Windows. Solution: Adjust the asserts. Skip the "messages maintainer" line if not showing all messages.

James McCoy jamessan at debian.org
Fri May 6 04:00:00 UTC 2016


This is an automated email from the git hooks/post-receive script.

jamessan pushed a commit to branch debian/sid
in repository vim.

commit bea1ede1c59a11ca5bf9d91cd30b7b2937b9fb41
Author: Bram Moolenaar <Bram at vim.org>
Date:   Thu Apr 14 19:44:36 2016 +0200

    patch 7.4.1739
    Problem:    Messages test fails on MS-Windows.
    Solution:   Adjust the asserts.  Skip the "messages maintainer" line if not
                showing all messages.
---
 src/message.c                 | 16 +++++++++-------
 src/testdir/test_messages.vim | 22 ++++++++++------------
 src/version.c                 |  2 ++
 3 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/src/message.c b/src/message.c
index 8d34c12..d3572eb 100644
--- a/src/message.c
+++ b/src/message.c
@@ -789,14 +789,7 @@ ex_messages(exarg_T *eap)
 
     msg_hist_off = TRUE;
 
-    s = mch_getenv((char_u *)"LANG");
-    if (s != NULL && *s != NUL)
-	msg_attr((char_u *)
-		_("Messages maintainer: Bram Moolenaar <Bram at vim.org>"),
-		hl_attr(HLF_T));
-
     p = first_msg_hist;
-
     if (eap->addr_count != 0)
     {
 	/* Count total messages */
@@ -810,6 +803,15 @@ ex_messages(exarg_T *eap)
 						    p = p->next, c--);
     }
 
+    if (p == first_msg_hist)
+    {
+	s = mch_getenv((char_u *)"LANG");
+	if (s != NULL && *s != NUL)
+	    msg_attr((char_u *)
+		    _("Messages maintainer: Bram Moolenaar <Bram at vim.org>"),
+		    hl_attr(HLF_T));
+    }
+
     /* Display what was not skipped. */
     for (; p != NULL && !got_int; p = p->next)
 	if (p->msg != NULL)
diff --git a/src/testdir/test_messages.vim b/src/testdir/test_messages.vim
index 4d7e411..188406e 100644
--- a/src/testdir/test_messages.vim
+++ b/src/testdir/test_messages.vim
@@ -4,6 +4,8 @@ function Test_messages()
   let oldmore = &more
   try
     set nomore
+    " Avoid the "message maintainer" line.
+    let $LANG = ''
 
     let arr = map(range(10), '"hello" . v:val')
     for s in arr
@@ -11,31 +13,27 @@ function Test_messages()
     endfor
     let result = ''
 
+    " get last two messages
     redir => result
     2messages | redraw
     redir END
-
-    " get last two messages
-    let msg = split(result, "\n")[1:][-2:]
-    call assert_equal(["hello8", "hello9"], msg)
+    let msg_list = split(result, "\n")
+    call assert_equal(["hello8", "hello9"], msg_list)
 
     " clear messages without last one
     1messages clear
     redir => result
-    redraw | 1messages
+    redraw | messages
     redir END
-    " get last last message
-    let msg = split(result, "\n")[1:][-1:]
-    call assert_equal(['hello9'], msg)
+    let msg_list = split(result, "\n")
+    call assert_equal(['hello9'], msg_list)
 
     " clear all messages
     messages clear
     redir => result
-    redraw | 1messages
+    redraw | messages
     redir END
-    " get last last message
-    let msg = split(result, "\n")[1:][-1:]
-    call assert_equal([], msg)
+    call assert_equal('', result)
   finally
     let &more = oldmore
   endtry
diff --git a/src/version.c b/src/version.c
index ad1511c..6bdb861 100644
--- a/src/version.c
+++ b/src/version.c
@@ -749,6 +749,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1739,
+/**/
     1738,
 /**/
     1737,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vim/vim.git



More information about the pkg-vim-maintainers mailing list