]> granicus.if.org Git - vim/commitdiff
patch 7.4.1739 v7.4.1739
authorBram Moolenaar <Bram@vim.org>
Thu, 14 Apr 2016 17:44:36 +0000 (19:44 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 14 Apr 2016 17:44:36 +0000 (19:44 +0200)
Problem:    Messages test fails on MS-Windows.
Solution:   Adjust the asserts.  Skip the "messages maintainer" line if not
            showing all messages.

src/message.c
src/testdir/test_messages.vim
src/version.c

index 8d34c127951e98fe27eee4b2bddd0476ecffb4bd..d3572eb420892ab297cb093c716c742db1ea920c 100644 (file)
@@ -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@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@vim.org>"),
+                   hl_attr(HLF_T));
+    }
+
     /* Display what was not skipped. */
     for (; p != NULL && !got_int; p = p->next)
        if (p->msg != NULL)
index 4d7e41130c8b240ac698390103a14fbdaa22fcd7..188406e440d477ae9fc0bbb33b52e0ae2bb2dba1 100644 (file)
@@ -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
index ad1511c96dd4c2f2071062dae2866e45787714e6..6bdb86145b0a1b3d7e641aca0eee0a94d209341f 100644 (file)
@@ -748,6 +748,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1739,
 /**/
     1738,
 /**/