comparison src/testdir/test_messages.vim @ 8897:a410390e340b v7.4.1735

commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Apr 14 17:16:22 2016 +0200 patch 7.4.1735 Problem: It is not possible to only see part of the message history. It is not possible to clear messages. Solution: Add a count to ":messages" and a clear argument. (Yasuhiro Matsumoto)
author Christian Brabandt <cb@256bit.org>
date Thu, 14 Apr 2016 17:30:07 +0200
parents
children 9200836eee15
comparison
equal deleted inserted replaced
8896:fc57c7ed0642 8897:a410390e340b
1 " Tests for :messages
2
3 function Test_messages()
4 let oldmore = &more
5 try
6 set nomore
7
8 let arr = map(range(10), '"hello" . v:val')
9 for s in arr
10 echomsg s | redraw
11 endfor
12 let result = ''
13
14 redir => result
15 2messages | redraw
16 redir END
17
18 " get last two messages
19 let msg = split(result, "\n")[1:][-2:]
20 call assert_equal(["hello8", "hello9"], msg)
21
22 " clear messages without last one
23 1messages clear
24 redir => result
25 redraw | 1messages
26 redir END
27 " get last last message
28 let msg = split(result, "\n")[1:][-1:]
29 call assert_equal(['hello9'], msg)
30
31 " clear all messages
32 messages clear
33 redir => result
34 redraw | 1messages
35 redir END
36 " get last last message
37 let msg = split(result, "\n")[1:][-1:]
38 call assert_equal([], msg)
39 finally
40 let &more = oldmore
41 endtry
42 endfunction