Mercurial > vim
annotate src/testdir/test_messages.vim @ 14683:c833cf17a4b1 v8.1.0354
patch 8.1.0354: packadd test fails on MS-Windows
commit https://github.com/vim/vim/commit/53c8a478cc4265549597b00214e0da812154742e
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 8 19:12:12 2018 +0200
patch 8.1.0354: packadd test fails on MS-Windows
Problem: Packadd test fails on MS-Windows.
Solution: Ignore difference between forward and backward slashes.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 08 Sep 2018 19:15:05 +0200 |
parents | 51693b1a640e |
children | 1946487c74ba |
rev | line source |
---|---|
8897
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for :messages |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 function Test_messages() |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 let oldmore = &more |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 try |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 set nomore |
8905
9200836eee15
commit https://github.com/vim/vim/commit/bea1ede1c59a11ca5bf9d91cd30b7b2937b9fb41
Christian Brabandt <cb@256bit.org>
parents:
8897
diff
changeset
|
7 " Avoid the "message maintainer" line. |
9200836eee15
commit https://github.com/vim/vim/commit/bea1ede1c59a11ca5bf9d91cd30b7b2937b9fb41
Christian Brabandt <cb@256bit.org>
parents:
8897
diff
changeset
|
8 let $LANG = '' |
8897
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 let arr = map(range(10), '"hello" . v:val') |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 for s in arr |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 echomsg s | redraw |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 endfor |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 let result = '' |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 |
8905
9200836eee15
commit https://github.com/vim/vim/commit/bea1ede1c59a11ca5bf9d91cd30b7b2937b9fb41
Christian Brabandt <cb@256bit.org>
parents:
8897
diff
changeset
|
16 " get last two messages |
8897
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 redir => result |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 2messages | redraw |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 redir END |
8905
9200836eee15
commit https://github.com/vim/vim/commit/bea1ede1c59a11ca5bf9d91cd30b7b2937b9fb41
Christian Brabandt <cb@256bit.org>
parents:
8897
diff
changeset
|
20 let msg_list = split(result, "\n") |
9200836eee15
commit https://github.com/vim/vim/commit/bea1ede1c59a11ca5bf9d91cd30b7b2937b9fb41
Christian Brabandt <cb@256bit.org>
parents:
8897
diff
changeset
|
21 call assert_equal(["hello8", "hello9"], msg_list) |
8897
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 " clear messages without last one |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 1messages clear |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 redir => result |
8905
9200836eee15
commit https://github.com/vim/vim/commit/bea1ede1c59a11ca5bf9d91cd30b7b2937b9fb41
Christian Brabandt <cb@256bit.org>
parents:
8897
diff
changeset
|
26 redraw | messages |
8897
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 redir END |
8905
9200836eee15
commit https://github.com/vim/vim/commit/bea1ede1c59a11ca5bf9d91cd30b7b2937b9fb41
Christian Brabandt <cb@256bit.org>
parents:
8897
diff
changeset
|
28 let msg_list = split(result, "\n") |
9200836eee15
commit https://github.com/vim/vim/commit/bea1ede1c59a11ca5bf9d91cd30b7b2937b9fb41
Christian Brabandt <cb@256bit.org>
parents:
8897
diff
changeset
|
29 call assert_equal(['hello9'], msg_list) |
8897
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 " clear all messages |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 messages clear |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 redir => result |
8905
9200836eee15
commit https://github.com/vim/vim/commit/bea1ede1c59a11ca5bf9d91cd30b7b2937b9fb41
Christian Brabandt <cb@256bit.org>
parents:
8897
diff
changeset
|
34 redraw | messages |
8897
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 redir END |
8905
9200836eee15
commit https://github.com/vim/vim/commit/bea1ede1c59a11ca5bf9d91cd30b7b2937b9fb41
Christian Brabandt <cb@256bit.org>
parents:
8897
diff
changeset
|
36 call assert_equal('', result) |
8897
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 finally |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 let &more = oldmore |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 endtry |
a410390e340b
commit https://github.com/vim/vim/commit/451f849fd6282a4facd4f0f58af62837443fb5a6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 endfunction |
13968
d111462e0173
patch 8.1.0002: :stopinsert changes the message position
Christian Brabandt <cb@256bit.org>
parents:
8905
diff
changeset
|
41 |
14202
51693b1a640e
patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents:
13968
diff
changeset
|
42 " Patch 7.4.1696 defined the "clearmode()" function for clearing the mode |
13968
d111462e0173
patch 8.1.0002: :stopinsert changes the message position
Christian Brabandt <cb@256bit.org>
parents:
8905
diff
changeset
|
43 " indicator (e.g., "-- INSERT --") when ":stopinsert" is invoked. Message |
d111462e0173
patch 8.1.0002: :stopinsert changes the message position
Christian Brabandt <cb@256bit.org>
parents:
8905
diff
changeset
|
44 " output could then be disturbed when 'cmdheight' was greater than one. |
d111462e0173
patch 8.1.0002: :stopinsert changes the message position
Christian Brabandt <cb@256bit.org>
parents:
8905
diff
changeset
|
45 " This test ensures that the bugfix for this issue remains in place. |
d111462e0173
patch 8.1.0002: :stopinsert changes the message position
Christian Brabandt <cb@256bit.org>
parents:
8905
diff
changeset
|
46 function! Test_stopinsert_does_not_break_message_output() |
d111462e0173
patch 8.1.0002: :stopinsert changes the message position
Christian Brabandt <cb@256bit.org>
parents:
8905
diff
changeset
|
47 set cmdheight=2 |
d111462e0173
patch 8.1.0002: :stopinsert changes the message position
Christian Brabandt <cb@256bit.org>
parents:
8905
diff
changeset
|
48 redraw! |
d111462e0173
patch 8.1.0002: :stopinsert changes the message position
Christian Brabandt <cb@256bit.org>
parents:
8905
diff
changeset
|
49 |
d111462e0173
patch 8.1.0002: :stopinsert changes the message position
Christian Brabandt <cb@256bit.org>
parents:
8905
diff
changeset
|
50 stopinsert | echo 'test echo' |
d111462e0173
patch 8.1.0002: :stopinsert changes the message position
Christian Brabandt <cb@256bit.org>
parents:
8905
diff
changeset
|
51 call assert_equal(116, screenchar(&lines - 1, 1)) |
d111462e0173
patch 8.1.0002: :stopinsert changes the message position
Christian Brabandt <cb@256bit.org>
parents:
8905
diff
changeset
|
52 call assert_equal(32, screenchar(&lines, 1)) |
d111462e0173
patch 8.1.0002: :stopinsert changes the message position
Christian Brabandt <cb@256bit.org>
parents:
8905
diff
changeset
|
53 redraw! |
d111462e0173
patch 8.1.0002: :stopinsert changes the message position
Christian Brabandt <cb@256bit.org>
parents:
8905
diff
changeset
|
54 |
d111462e0173
patch 8.1.0002: :stopinsert changes the message position
Christian Brabandt <cb@256bit.org>
parents:
8905
diff
changeset
|
55 stopinsert | echomsg 'test echomsg' |
d111462e0173
patch 8.1.0002: :stopinsert changes the message position
Christian Brabandt <cb@256bit.org>
parents:
8905
diff
changeset
|
56 call assert_equal(116, screenchar(&lines - 1, 1)) |
d111462e0173
patch 8.1.0002: :stopinsert changes the message position
Christian Brabandt <cb@256bit.org>
parents:
8905
diff
changeset
|
57 call assert_equal(32, screenchar(&lines, 1)) |
d111462e0173
patch 8.1.0002: :stopinsert changes the message position
Christian Brabandt <cb@256bit.org>
parents:
8905
diff
changeset
|
58 redraw! |
d111462e0173
patch 8.1.0002: :stopinsert changes the message position
Christian Brabandt <cb@256bit.org>
parents:
8905
diff
changeset
|
59 |
d111462e0173
patch 8.1.0002: :stopinsert changes the message position
Christian Brabandt <cb@256bit.org>
parents:
8905
diff
changeset
|
60 set cmdheight& |
d111462e0173
patch 8.1.0002: :stopinsert changes the message position
Christian Brabandt <cb@256bit.org>
parents:
8905
diff
changeset
|
61 endfunction |