Mercurial > vim
annotate src/testdir/test_quickfix.vim @ 10275:6d8b2da002e9 v8.0.0034
commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Oct 15 15:39:39 2016 +0200
patch 8.0.0034
Problem: No completion for ":messages".
Solution: Complete "clear" argument. (Hirohito Higashi)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 15 Oct 2016 15:45:05 +0200 |
parents | 2d0e6034743a |
children | 92fa8e5ef210 |
rev | line source |
---|---|
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Test for the quickfix commands. |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 if !has('quickfix') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 finish |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 endif |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 |
8649
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
7 set encoding=utf-8 |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
8 |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
9 function! s:setup_commands(cchar) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
10 if a:cchar == 'c' |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
11 command! -nargs=* -bang Xlist <mods>clist<bang> <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
12 command! -nargs=* Xgetexpr <mods>cgetexpr <args> |
9397
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
13 command! -nargs=* Xaddexpr <mods>caddexpr <args> |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
14 command! -nargs=* Xolder <mods>colder <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
15 command! -nargs=* Xnewer <mods>cnewer <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
16 command! -nargs=* Xopen <mods>copen <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
17 command! -nargs=* Xwindow <mods>cwindow <args> |
9458
374afcf9d11d
commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents:
9432
diff
changeset
|
18 command! -nargs=* Xbottom <mods>cbottom <args> |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
19 command! -nargs=* Xclose <mods>cclose <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
20 command! -nargs=* -bang Xfile <mods>cfile<bang> <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
21 command! -nargs=* Xgetfile <mods>cgetfile <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
22 command! -nargs=* Xaddfile <mods>caddfile <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
23 command! -nargs=* -bang Xbuffer <mods>cbuffer<bang> <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
24 command! -nargs=* Xgetbuffer <mods>cgetbuffer <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
25 command! -nargs=* Xaddbuffer <mods>caddbuffer <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
26 command! -nargs=* Xrewind <mods>crewind <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
27 command! -nargs=* -bang Xnext <mods>cnext<bang> <args> |
9405
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
28 command! -nargs=* -bang Xprev <mods>cprev<bang> <args> |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
29 command! -nargs=* -bang Xfirst <mods>cfirst<bang> <args> |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
30 command! -nargs=* -bang Xlast <mods>clast<bang> <args> |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
31 command! -nargs=* -bang Xnfile <mods>cnfile<bang> <args> |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
32 command! -nargs=* -bang Xpfile <mods>cpfile<bang> <args> |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
33 command! -nargs=* Xexpr <mods>cexpr <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
34 command! -nargs=* Xvimgrep <mods>vimgrep <args> |
9342
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
35 command! -nargs=* Xgrep <mods> grep <args> |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
36 command! -nargs=* Xgrepadd <mods> grepadd <args> |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
37 command! -nargs=* Xhelpgrep helpgrep <args> |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
38 let g:Xgetlist = function('getqflist') |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
39 let g:Xsetlist = function('setqflist') |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
40 else |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
41 command! -nargs=* -bang Xlist <mods>llist<bang> <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
42 command! -nargs=* Xgetexpr <mods>lgetexpr <args> |
9397
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
43 command! -nargs=* Xaddexpr <mods>laddexpr <args> |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
44 command! -nargs=* Xolder <mods>lolder <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
45 command! -nargs=* Xnewer <mods>lnewer <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
46 command! -nargs=* Xopen <mods>lopen <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
47 command! -nargs=* Xwindow <mods>lwindow <args> |
9458
374afcf9d11d
commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents:
9432
diff
changeset
|
48 command! -nargs=* Xbottom <mods>lbottom <args> |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
49 command! -nargs=* Xclose <mods>lclose <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
50 command! -nargs=* -bang Xfile <mods>lfile<bang> <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
51 command! -nargs=* Xgetfile <mods>lgetfile <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
52 command! -nargs=* Xaddfile <mods>laddfile <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
53 command! -nargs=* -bang Xbuffer <mods>lbuffer<bang> <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
54 command! -nargs=* Xgetbuffer <mods>lgetbuffer <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
55 command! -nargs=* Xaddbuffer <mods>laddbuffer <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
56 command! -nargs=* Xrewind <mods>lrewind <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
57 command! -nargs=* -bang Xnext <mods>lnext<bang> <args> |
9405
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
58 command! -nargs=* -bang Xprev <mods>lprev<bang> <args> |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
59 command! -nargs=* -bang Xfirst <mods>lfirst<bang> <args> |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
60 command! -nargs=* -bang Xlast <mods>llast<bang> <args> |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
61 command! -nargs=* -bang Xnfile <mods>lnfile<bang> <args> |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
62 command! -nargs=* -bang Xpfile <mods>lpfile<bang> <args> |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
63 command! -nargs=* Xexpr <mods>lexpr <args> |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
64 command! -nargs=* Xvimgrep <mods>lvimgrep <args> |
9342
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
65 command! -nargs=* Xgrep <mods> lgrep <args> |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
66 command! -nargs=* Xgrepadd <mods> lgrepadd <args> |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
67 command! -nargs=* Xhelpgrep lhelpgrep <args> |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
68 let g:Xgetlist = function('getloclist', [0]) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
69 let g:Xsetlist = function('setloclist', [0]) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
70 endif |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
71 endfunction |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
72 |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
73 " Tests for the :clist and :llist commands |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
74 function XlistTests(cchar) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
75 call s:setup_commands(a:cchar) |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
76 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
77 " With an empty list, command should return error |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
78 Xgetexpr [] |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
79 silent! Xlist |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
80 call assert_true(v:errmsg ==# 'E42: No Errors') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
81 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
82 " Populate the list and then try |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
83 Xgetexpr ['non-error 1', 'Xtestfile1:1:3:Line1', |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
84 \ 'non-error 2', 'Xtestfile2:2:2:Line2', |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
85 \ 'non-error 3', 'Xtestfile3:3:1:Line3'] |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
86 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
87 " List only valid entries |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
88 redir => result |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
89 Xlist |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
90 redir END |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
91 let l = split(result, "\n") |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
92 call assert_equal([' 2 Xtestfile1:1 col 3: Line1', |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
93 \ ' 4 Xtestfile2:2 col 2: Line2', |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
94 \ ' 6 Xtestfile3:3 col 1: Line3'], l) |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
95 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
96 " List all the entries |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
97 redir => result |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
98 Xlist! |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
99 redir END |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
100 let l = split(result, "\n") |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
101 call assert_equal([' 1: non-error 1', ' 2 Xtestfile1:1 col 3: Line1', |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
102 \ ' 3: non-error 2', ' 4 Xtestfile2:2 col 2: Line2', |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
103 \ ' 5: non-error 3', ' 6 Xtestfile3:3 col 1: Line3'], l) |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
104 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
105 " List a range of errors |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
106 redir => result |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
107 Xlist 3,6 |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
108 redir END |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
109 let l = split(result, "\n") |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
110 call assert_equal([' 4 Xtestfile2:2 col 2: Line2', |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
111 \ ' 6 Xtestfile3:3 col 1: Line3'], l) |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
112 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
113 redir => result |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
114 Xlist! 3,4 |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
115 redir END |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
116 let l = split(result, "\n") |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
117 call assert_equal([' 3: non-error 2', ' 4 Xtestfile2:2 col 2: Line2'], l) |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
118 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
119 redir => result |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
120 Xlist -6,-4 |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
121 redir END |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
122 let l = split(result, "\n") |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
123 call assert_equal([' 2 Xtestfile1:1 col 3: Line1'], l) |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
124 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
125 redir => result |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
126 Xlist! -5,-3 |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
127 redir END |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
128 let l = split(result, "\n") |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
129 call assert_equal([' 2 Xtestfile1:1 col 3: Line1', |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
130 \ ' 3: non-error 2', ' 4 Xtestfile2:2 col 2: Line2'], l) |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
131 endfunction |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
132 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
133 function Test_clist() |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
134 call XlistTests('c') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
135 call XlistTests('l') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
136 endfunction |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
137 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
138 " Tests for the :colder, :cnewer, :lolder and :lnewer commands |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
139 " Note that this test assumes that a quickfix/location list is |
7540
b910bb01832a
commit https://github.com/vim/vim/commit/cfc0a350a9fa04f1b0cfa1ba31fbd2847376513f
Christian Brabandt <cb@256bit.org>
parents:
7513
diff
changeset
|
140 " already set by the caller. |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
141 function XageTests(cchar) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
142 call s:setup_commands(a:cchar) |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
143 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
144 " Jumping to a non existent list should return error |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
145 silent! Xolder 99 |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
146 call assert_true(v:errmsg ==# 'E380: At bottom of quickfix stack') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
147 |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
148 silent! Xnewer 99 |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
149 call assert_true(v:errmsg ==# 'E381: At top of quickfix stack') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
150 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
151 " Add three quickfix/location lists |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
152 Xgetexpr ['Xtestfile1:1:3:Line1'] |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
153 Xgetexpr ['Xtestfile2:2:2:Line2'] |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
154 Xgetexpr ['Xtestfile3:3:1:Line3'] |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
155 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
156 " Go back two lists |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
157 Xolder |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
158 let l = g:Xgetlist() |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
159 call assert_equal('Line2', l[0].text) |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
160 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
161 " Go forward two lists |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
162 Xnewer |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
163 let l = g:Xgetlist() |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
164 call assert_equal('Line3', l[0].text) |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
165 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
166 " Test for the optional count argument |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
167 Xolder 2 |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
168 let l = g:Xgetlist() |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
169 call assert_equal('Line1', l[0].text) |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
170 |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
171 Xnewer 2 |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
172 let l = g:Xgetlist() |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
173 call assert_equal('Line3', l[0].text) |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
174 endfunction |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
175 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
176 function Test_cage() |
7540
b910bb01832a
commit https://github.com/vim/vim/commit/cfc0a350a9fa04f1b0cfa1ba31fbd2847376513f
Christian Brabandt <cb@256bit.org>
parents:
7513
diff
changeset
|
177 let list = [{'bufnr': 1, 'lnum': 1}] |
b910bb01832a
commit https://github.com/vim/vim/commit/cfc0a350a9fa04f1b0cfa1ba31fbd2847376513f
Christian Brabandt <cb@256bit.org>
parents:
7513
diff
changeset
|
178 call setqflist(list) |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
179 call XageTests('c') |
7540
b910bb01832a
commit https://github.com/vim/vim/commit/cfc0a350a9fa04f1b0cfa1ba31fbd2847376513f
Christian Brabandt <cb@256bit.org>
parents:
7513
diff
changeset
|
180 |
b910bb01832a
commit https://github.com/vim/vim/commit/cfc0a350a9fa04f1b0cfa1ba31fbd2847376513f
Christian Brabandt <cb@256bit.org>
parents:
7513
diff
changeset
|
181 call setloclist(0, list) |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
182 call XageTests('l') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
183 endfunction |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
184 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
185 " Tests for the :cwindow, :lwindow :cclose, :lclose, :copen and :lopen |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
186 " commands |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
187 function XwindowTests(cchar) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
188 call s:setup_commands(a:cchar) |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
189 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
190 " Create a list with no valid entries |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
191 Xgetexpr ['non-error 1', 'non-error 2', 'non-error 3'] |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
192 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
193 " Quickfix/Location window should not open with no valid errors |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
194 Xwindow |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
195 call assert_true(winnr('$') == 1) |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
196 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
197 " Create a list with valid entries |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
198 Xgetexpr ['Xtestfile1:1:3:Line1', 'Xtestfile2:2:2:Line2', |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
199 \ 'Xtestfile3:3:1:Line3'] |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
200 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
201 " Open the window |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
202 Xwindow |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
203 call assert_true(winnr('$') == 2 && winnr() == 2 && |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
204 \ getline('.') ==# 'Xtestfile1|1 col 3| Line1') |
9458
374afcf9d11d
commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents:
9432
diff
changeset
|
205 redraw! |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
206 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
207 " Close the window |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
208 Xclose |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
209 call assert_true(winnr('$') == 1) |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
210 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
211 " Create a list with no valid entries |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
212 Xgetexpr ['non-error 1', 'non-error 2', 'non-error 3'] |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
213 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
214 " Open the window |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
215 Xopen 5 |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
216 call assert_true(winnr('$') == 2 && getline('.') ==# '|| non-error 1' |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
217 \ && winheight('.') == 5) |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
218 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
219 " Opening the window again, should move the cursor to that window |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
220 wincmd t |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
221 Xopen 7 |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
222 call assert_true(winnr('$') == 2 && winnr() == 2 && |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
223 \ winheight('.') == 7 && |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
224 \ getline('.') ==# '|| non-error 1') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
225 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
226 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
227 " Calling cwindow should close the quickfix window with no valid errors |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
228 Xwindow |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
229 call assert_true(winnr('$') == 1) |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
230 endfunction |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
231 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
232 function Test_cwindow() |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
233 call XwindowTests('c') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
234 call XwindowTests('l') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
235 endfunction |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
236 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
237 " Tests for the :cfile, :lfile, :caddfile, :laddfile, :cgetfile and :lgetfile |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
238 " commands. |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
239 function XfileTests(cchar) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
240 call s:setup_commands(a:cchar) |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
241 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
242 call writefile(['Xtestfile1:700:10:Line 700', |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
243 \ 'Xtestfile2:800:15:Line 800'], 'Xqftestfile1') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
244 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
245 enew! |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
246 Xfile Xqftestfile1 |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
247 let l = g:Xgetlist() |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
248 call assert_true(len(l) == 2 && |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
249 \ l[0].lnum == 700 && l[0].col == 10 && l[0].text ==# 'Line 700' && |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
250 \ l[1].lnum == 800 && l[1].col == 15 && l[1].text ==# 'Line 800') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
251 |
9342
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
252 " Test with a non existent file |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
253 call assert_fails('Xfile non_existent_file', 'E40') |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
254 |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
255 " Run cfile/lfile from a modified buffer |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
256 enew! |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
257 silent! put ='Quickfix' |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
258 silent! Xfile Xqftestfile1 |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
259 call assert_true(v:errmsg ==# 'E37: No write since last change (add ! to override)') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
260 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
261 call writefile(['Xtestfile3:900:30:Line 900'], 'Xqftestfile1') |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
262 Xaddfile Xqftestfile1 |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
263 let l = g:Xgetlist() |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
264 call assert_true(len(l) == 3 && |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
265 \ l[2].lnum == 900 && l[2].col == 30 && l[2].text ==# 'Line 900') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
266 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
267 call writefile(['Xtestfile1:222:77:Line 222', |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
268 \ 'Xtestfile2:333:88:Line 333'], 'Xqftestfile1') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
269 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
270 enew! |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
271 Xgetfile Xqftestfile1 |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
272 let l = g:Xgetlist() |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
273 call assert_true(len(l) == 2 && |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
274 \ l[0].lnum == 222 && l[0].col == 77 && l[0].text ==# 'Line 222' && |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
275 \ l[1].lnum == 333 && l[1].col == 88 && l[1].text ==# 'Line 333') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
276 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
277 call delete('Xqftestfile1') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
278 endfunction |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
279 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
280 function Test_cfile() |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
281 call XfileTests('c') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
282 call XfileTests('l') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
283 endfunction |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
284 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
285 " Tests for the :cbuffer, :lbuffer, :caddbuffer, :laddbuffer, :cgetbuffer and |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
286 " :lgetbuffer commands. |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
287 function XbufferTests(cchar) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
288 call s:setup_commands(a:cchar) |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
289 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
290 enew! |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
291 silent! call setline(1, ['Xtestfile7:700:10:Line 700', |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
292 \ 'Xtestfile8:800:15:Line 800']) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
293 Xbuffer! |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
294 let l = g:Xgetlist() |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
295 call assert_true(len(l) == 2 && |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
296 \ l[0].lnum == 700 && l[0].col == 10 && l[0].text ==# 'Line 700' && |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
297 \ l[1].lnum == 800 && l[1].col == 15 && l[1].text ==# 'Line 800') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
298 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
299 enew! |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
300 silent! call setline(1, ['Xtestfile9:900:55:Line 900', |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
301 \ 'Xtestfile10:950:66:Line 950']) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
302 Xgetbuffer |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
303 let l = g:Xgetlist() |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
304 call assert_true(len(l) == 2 && |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
305 \ l[0].lnum == 900 && l[0].col == 55 && l[0].text ==# 'Line 900' && |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
306 \ l[1].lnum == 950 && l[1].col == 66 && l[1].text ==# 'Line 950') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
307 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
308 enew! |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
309 silent! call setline(1, ['Xtestfile11:700:20:Line 700', |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
310 \ 'Xtestfile12:750:25:Line 750']) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
311 Xaddbuffer |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
312 let l = g:Xgetlist() |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
313 call assert_true(len(l) == 4 && |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
314 \ l[1].lnum == 950 && l[1].col == 66 && l[1].text ==# 'Line 950' && |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
315 \ l[2].lnum == 700 && l[2].col == 20 && l[2].text ==# 'Line 700' && |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
316 \ l[3].lnum == 750 && l[3].col == 25 && l[3].text ==# 'Line 750') |
9309
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
317 enew! |
7502
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
318 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
319 endfunction |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
320 |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
321 function Test_cbuffer() |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
322 call XbufferTests('c') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
323 call XbufferTests('l') |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
324 endfunction |
3e306ae760d0
commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
325 |
9405
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
326 function XexprTests(cchar) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
327 call s:setup_commands(a:cchar) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
328 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
329 call assert_fails('Xexpr 10', 'E777:') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
330 endfunction |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
331 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
332 function Test_cexpr() |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
333 call XexprTests('c') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
334 call XexprTests('l') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
335 endfunction |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
336 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
337 " Tests for :cnext, :cprev, :cfirst, :clast commands |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
338 function Xtest_browse(cchar) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
339 call s:setup_commands(a:cchar) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
340 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
341 call s:create_test_file('Xqftestfile1') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
342 call s:create_test_file('Xqftestfile2') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
343 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
344 Xgetexpr ['Xqftestfile1:5:Line5', |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
345 \ 'Xqftestfile1:6:Line6', |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
346 \ 'Xqftestfile2:10:Line10', |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
347 \ 'Xqftestfile2:11:Line11'] |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
348 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
349 Xfirst |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
350 call assert_fails('Xprev', 'E553') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
351 call assert_fails('Xpfile', 'E553') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
352 Xnfile |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
353 call assert_equal('Xqftestfile2', bufname('%')) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
354 call assert_equal(10, line('.')) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
355 Xpfile |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
356 call assert_equal('Xqftestfile1', bufname('%')) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
357 call assert_equal(6, line('.')) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
358 Xlast |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
359 call assert_equal('Xqftestfile2', bufname('%')) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
360 call assert_equal(11, line('.')) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
361 call assert_fails('Xnext', 'E553') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
362 call assert_fails('Xnfile', 'E553') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
363 Xrewind |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
364 call assert_equal('Xqftestfile1', bufname('%')) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
365 call assert_equal(5, line('.')) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
366 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
367 call delete('Xqftestfile1') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
368 call delete('Xqftestfile2') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
369 endfunction |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
370 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
371 function Test_browse() |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
372 call Xtest_browse('c') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
373 call Xtest_browse('l') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
374 endfunction |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
375 |
7513
37e061ec063c
commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents:
7502
diff
changeset
|
376 function Test_nomem() |
9121
7350959e53c3
commit https://github.com/vim/vim/commit/8e8df251bf2505e5decf258397c6069fbe5e2e01
Christian Brabandt <cb@256bit.org>
parents:
9114
diff
changeset
|
377 call test_alloc_fail(GetAllocId('qf_dirname_start'), 0, 0) |
7593
87e607fb6853
commit https://github.com/vim/vim/commit/a260b87d9da17f605666630f18c1ed909c2b8bae
Christian Brabandt <cb@256bit.org>
parents:
7545
diff
changeset
|
378 call assert_fails('vimgrep vim runtest.vim', 'E342:') |
7513
37e061ec063c
commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents:
7502
diff
changeset
|
379 |
9121
7350959e53c3
commit https://github.com/vim/vim/commit/8e8df251bf2505e5decf258397c6069fbe5e2e01
Christian Brabandt <cb@256bit.org>
parents:
9114
diff
changeset
|
380 call test_alloc_fail(GetAllocId('qf_dirname_now'), 0, 0) |
7593
87e607fb6853
commit https://github.com/vim/vim/commit/a260b87d9da17f605666630f18c1ed909c2b8bae
Christian Brabandt <cb@256bit.org>
parents:
7545
diff
changeset
|
381 call assert_fails('vimgrep vim runtest.vim', 'E342:') |
7513
37e061ec063c
commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents:
7502
diff
changeset
|
382 |
9121
7350959e53c3
commit https://github.com/vim/vim/commit/8e8df251bf2505e5decf258397c6069fbe5e2e01
Christian Brabandt <cb@256bit.org>
parents:
9114
diff
changeset
|
383 call test_alloc_fail(GetAllocId('qf_namebuf'), 0, 0) |
7593
87e607fb6853
commit https://github.com/vim/vim/commit/a260b87d9da17f605666630f18c1ed909c2b8bae
Christian Brabandt <cb@256bit.org>
parents:
7545
diff
changeset
|
384 call assert_fails('cfile runtest.vim', 'E342:') |
7513
37e061ec063c
commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents:
7502
diff
changeset
|
385 |
9121
7350959e53c3
commit https://github.com/vim/vim/commit/8e8df251bf2505e5decf258397c6069fbe5e2e01
Christian Brabandt <cb@256bit.org>
parents:
9114
diff
changeset
|
386 call test_alloc_fail(GetAllocId('qf_errmsg'), 0, 0) |
7593
87e607fb6853
commit https://github.com/vim/vim/commit/a260b87d9da17f605666630f18c1ed909c2b8bae
Christian Brabandt <cb@256bit.org>
parents:
7545
diff
changeset
|
387 call assert_fails('cfile runtest.vim', 'E342:') |
7513
37e061ec063c
commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents:
7502
diff
changeset
|
388 |
9121
7350959e53c3
commit https://github.com/vim/vim/commit/8e8df251bf2505e5decf258397c6069fbe5e2e01
Christian Brabandt <cb@256bit.org>
parents:
9114
diff
changeset
|
389 call test_alloc_fail(GetAllocId('qf_pattern'), 0, 0) |
7593
87e607fb6853
commit https://github.com/vim/vim/commit/a260b87d9da17f605666630f18c1ed909c2b8bae
Christian Brabandt <cb@256bit.org>
parents:
7545
diff
changeset
|
390 call assert_fails('cfile runtest.vim', 'E342:') |
7513
37e061ec063c
commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents:
7502
diff
changeset
|
391 |
37e061ec063c
commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents:
7502
diff
changeset
|
392 endfunc |
37e061ec063c
commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents:
7502
diff
changeset
|
393 |
9342
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
394 function! s:test_xhelpgrep(cchar) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
395 call s:setup_commands(a:cchar) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
396 Xhelpgrep quickfix |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
397 Xopen |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
398 if a:cchar == 'c' |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
399 let title_text = ':helpgrep quickfix' |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
400 else |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
401 let title_text = ':lhelpgrep quickfix' |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
402 endif |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
403 call assert_true(w:quickfix_title =~ title_text, w:quickfix_title) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
404 " This wipes out the buffer, make sure that doesn't cause trouble. |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
405 Xclose |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
406 endfunction |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
407 |
7677
85a7a945fb87
commit https://github.com/vim/vim/commit/62ef797496c6243d111c596a592a8ef8c1d1e710
Christian Brabandt <cb@256bit.org>
parents:
7593
diff
changeset
|
408 function Test_helpgrep() |
9342
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
409 call s:test_xhelpgrep('c') |
9752
429be545637a
commit https://github.com/vim/vim/commit/cf25fdb8f10a92b3bf9e295c466c1b69812b7886
Christian Brabandt <cb@256bit.org>
parents:
9608
diff
changeset
|
410 helpclose |
9342
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
411 call s:test_xhelpgrep('l') |
7677
85a7a945fb87
commit https://github.com/vim/vim/commit/62ef797496c6243d111c596a592a8ef8c1d1e710
Christian Brabandt <cb@256bit.org>
parents:
7593
diff
changeset
|
412 endfunc |
7513
37e061ec063c
commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents:
7502
diff
changeset
|
413 |
7710
bf58e9f8d52a
commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents:
7677
diff
changeset
|
414 func Test_errortitle() |
bf58e9f8d52a
commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents:
7677
diff
changeset
|
415 augroup QfBufWinEnter |
bf58e9f8d52a
commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents:
7677
diff
changeset
|
416 au! |
bf58e9f8d52a
commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents:
7677
diff
changeset
|
417 au BufWinEnter * :let g:a=get(w:, 'quickfix_title', 'NONE') |
bf58e9f8d52a
commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents:
7677
diff
changeset
|
418 augroup END |
bf58e9f8d52a
commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents:
7677
diff
changeset
|
419 copen |
bf58e9f8d52a
commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents:
7677
diff
changeset
|
420 let a=[{'lnum': 308, 'bufnr': bufnr(''), 'col': 58, 'valid': 1, 'vcol': 0, 'nr': 0, 'type': '', 'pattern': '', 'text': ' au BufWinEnter * :let g:a=get(w:, ''quickfix_title'', ''NONE'')'}] |
bf58e9f8d52a
commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents:
7677
diff
changeset
|
421 call setqflist(a) |
bf58e9f8d52a
commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents:
7677
diff
changeset
|
422 call assert_equal(':setqflist()', g:a) |
bf58e9f8d52a
commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents:
7677
diff
changeset
|
423 augroup QfBufWinEnter |
bf58e9f8d52a
commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents:
7677
diff
changeset
|
424 au! |
bf58e9f8d52a
commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents:
7677
diff
changeset
|
425 augroup END |
bf58e9f8d52a
commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents:
7677
diff
changeset
|
426 augroup! QfBufWinEnter |
bf58e9f8d52a
commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents:
7677
diff
changeset
|
427 endfunc |
8558
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
428 |
8603
bfa74b84c41c
commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents:
8597
diff
changeset
|
429 func Test_vimgreptitle() |
bfa74b84c41c
commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents:
8597
diff
changeset
|
430 augroup QfBufWinEnter |
bfa74b84c41c
commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents:
8597
diff
changeset
|
431 au! |
bfa74b84c41c
commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents:
8597
diff
changeset
|
432 au BufWinEnter * :let g:a=get(w:, 'quickfix_title', 'NONE') |
bfa74b84c41c
commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents:
8597
diff
changeset
|
433 augroup END |
bfa74b84c41c
commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents:
8597
diff
changeset
|
434 try |
bfa74b84c41c
commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents:
8597
diff
changeset
|
435 vimgrep /pattern/j file |
bfa74b84c41c
commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents:
8597
diff
changeset
|
436 catch /E480/ |
bfa74b84c41c
commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents:
8597
diff
changeset
|
437 endtry |
bfa74b84c41c
commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents:
8597
diff
changeset
|
438 copen |
bfa74b84c41c
commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents:
8597
diff
changeset
|
439 call assert_equal(': vimgrep /pattern/j file', g:a) |
bfa74b84c41c
commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents:
8597
diff
changeset
|
440 augroup QfBufWinEnter |
bfa74b84c41c
commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents:
8597
diff
changeset
|
441 au! |
bfa74b84c41c
commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents:
8597
diff
changeset
|
442 augroup END |
bfa74b84c41c
commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents:
8597
diff
changeset
|
443 augroup! QfBufWinEnter |
bfa74b84c41c
commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents:
8597
diff
changeset
|
444 endfunc |
bfa74b84c41c
commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents:
8597
diff
changeset
|
445 |
8558
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
446 function XqfTitleTests(cchar) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
447 call s:setup_commands(a:cchar) |
8558
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
448 |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
449 Xgetexpr ['file:1:1:message'] |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
450 let l = g:Xgetlist() |
8558
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
451 if a:cchar == 'c' |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
452 call setqflist(l, 'r') |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
453 else |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
454 call setloclist(0, l, 'r') |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
455 endif |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
456 |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
457 Xopen |
8558
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
458 if a:cchar == 'c' |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
459 let title = ':setqflist()' |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
460 else |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
461 let title = ':setloclist()' |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
462 endif |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
463 call assert_equal(title, w:quickfix_title) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
464 Xclose |
8558
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
465 endfunction |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
466 |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
467 " Tests for quickfix window's title |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
468 function Test_qf_title() |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
469 call XqfTitleTests('c') |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
470 call XqfTitleTests('l') |
8558
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
471 endfunction |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
472 |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
473 " Tests for 'errorformat' |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
474 function Test_efm() |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
475 let save_efm = &efm |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
476 set efm=%EEEE%m,%WWWW%m,%+CCCC%.%#,%-GGGG%.%# |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
477 cgetexpr ['WWWW', 'EEEE', 'CCCC'] |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
478 let l = strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]'))) |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
479 call assert_equal("[['W', 1], ['E^@CCCC', 1]]", l) |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
480 cgetexpr ['WWWW', 'GGGG', 'EEEE', 'CCCC'] |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
481 let l = strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]'))) |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
482 call assert_equal("[['W', 1], ['E^@CCCC', 1]]", l) |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
483 cgetexpr ['WWWW', 'GGGG', 'ZZZZ', 'EEEE', 'CCCC', 'YYYY'] |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
484 let l = strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]'))) |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
485 call assert_equal("[['W', 1], ['ZZZZ', 0], ['E^@CCCC', 1], ['YYYY', 0]]", l) |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
486 let &efm = save_efm |
22aecf80378e
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents:
7710
diff
changeset
|
487 endfunction |
8597
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
488 |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
489 " This will test for problems in quickfix: |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
490 " A. incorrectly copying location lists which caused the location list to show |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
491 " a different name than the file that was actually being displayed. |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
492 " B. not reusing the window for which the location list window is opened but |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
493 " instead creating new windows. |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
494 " C. make sure that the location list window is not reused instead of the |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
495 " window it belongs to. |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
496 " |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
497 " Set up the test environment: |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
498 function! ReadTestProtocol(name) |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
499 let base = substitute(a:name, '\v^test://(.*)%(\.[^.]+)?', '\1', '') |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
500 let word = substitute(base, '\v(.*)\..*', '\1', '') |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
501 |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
502 setl modifiable |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
503 setl noreadonly |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
504 setl noswapfile |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
505 setl bufhidden=delete |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
506 %del _ |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
507 " For problem 2: |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
508 " 'buftype' has to be set to reproduce the constant opening of new windows |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
509 setl buftype=nofile |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
510 |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
511 call setline(1, word) |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
512 |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
513 setl nomodified |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
514 setl nomodifiable |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
515 setl readonly |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
516 exe 'doautocmd BufRead ' . substitute(a:name, '\v^test://(.*)', '\1', '') |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
517 endfunction |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
518 |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
519 function Test_locationlist() |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
520 enew |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
521 |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
522 augroup testgroup |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
523 au! |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
524 autocmd BufReadCmd test://* call ReadTestProtocol(expand("<amatch>")) |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
525 augroup END |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
526 |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
527 let words = [ "foo", "bar", "baz", "quux", "shmoo", "spam", "eggs" ] |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
528 |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
529 let qflist = [] |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
530 for word in words |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
531 call add(qflist, {'filename': 'test://' . word . '.txt', 'text': 'file ' . word . '.txt', }) |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
532 " NOTE: problem 1: |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
533 " intentionally not setting 'lnum' so that the quickfix entries are not |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
534 " valid |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
535 call setloclist(0, qflist, ' ') |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
536 endfor |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
537 |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
538 " Test A |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
539 lrewind |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
540 enew |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
541 lopen |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
542 lnext |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
543 lnext |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
544 lnext |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
545 lnext |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
546 vert split |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
547 wincmd L |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
548 lopen |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
549 wincmd p |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
550 lnext |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
551 let fileName = expand("%") |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
552 wincmd p |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
553 let locationListFileName = substitute(getline(line('.')), '\([^|]*\)|.*', '\1', '') |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
554 let fileName = substitute(fileName, '\\', '/', 'g') |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
555 let locationListFileName = substitute(locationListFileName, '\\', '/', 'g') |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
556 call assert_equal("test://bar.txt", fileName) |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
557 call assert_equal("test://bar.txt", locationListFileName) |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
558 |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
559 wincmd n | only |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
560 |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
561 " Test B: |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
562 lrewind |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
563 lopen |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
564 2 |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
565 exe "normal \<CR>" |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
566 wincmd p |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
567 3 |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
568 exe "normal \<CR>" |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
569 wincmd p |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
570 4 |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
571 exe "normal \<CR>" |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
572 call assert_equal(2, winnr('$')) |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
573 wincmd n | only |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
574 |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
575 " Test C: |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
576 lrewind |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
577 lopen |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
578 " Let's move the location list window to the top to check whether it (the |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
579 " first window found) will be reused when we try to open new windows: |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
580 wincmd K |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
581 2 |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
582 exe "normal \<CR>" |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
583 wincmd p |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
584 3 |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
585 exe "normal \<CR>" |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
586 wincmd p |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
587 4 |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
588 exe "normal \<CR>" |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
589 1wincmd w |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
590 call assert_equal('quickfix', &buftype) |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
591 2wincmd w |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
592 let bufferName = expand("%") |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
593 let bufferName = substitute(bufferName, '\\', '/', 'g') |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
594 call assert_equal('test://quux.txt', bufferName) |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
595 |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
596 wincmd n | only |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
597 |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
598 augroup! testgroup |
51de88bf954d
commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents:
8558
diff
changeset
|
599 endfunction |
8605
536b9b88d1ca
commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents:
8603
diff
changeset
|
600 |
536b9b88d1ca
commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents:
8603
diff
changeset
|
601 function Test_locationlist_curwin_was_closed() |
536b9b88d1ca
commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents:
8603
diff
changeset
|
602 augroup testgroup |
536b9b88d1ca
commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents:
8603
diff
changeset
|
603 au! |
8965
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
604 autocmd BufReadCmd test_curwin.txt call R(expand("<amatch>")) |
8605
536b9b88d1ca
commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents:
8603
diff
changeset
|
605 augroup END |
536b9b88d1ca
commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents:
8603
diff
changeset
|
606 |
8702
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
607 function! R(n) |
8605
536b9b88d1ca
commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents:
8603
diff
changeset
|
608 quit |
536b9b88d1ca
commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents:
8603
diff
changeset
|
609 endfunc |
536b9b88d1ca
commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents:
8603
diff
changeset
|
610 |
536b9b88d1ca
commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents:
8603
diff
changeset
|
611 new |
536b9b88d1ca
commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents:
8603
diff
changeset
|
612 let q = [] |
8965
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
613 call add(q, {'filename': 'test_curwin.txt' }) |
8605
536b9b88d1ca
commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents:
8603
diff
changeset
|
614 call setloclist(0, q) |
536b9b88d1ca
commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents:
8603
diff
changeset
|
615 call assert_fails('lrewind', 'E924:') |
536b9b88d1ca
commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents:
8603
diff
changeset
|
616 |
536b9b88d1ca
commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents:
8603
diff
changeset
|
617 augroup! testgroup |
536b9b88d1ca
commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents:
8603
diff
changeset
|
618 endfunction |
8649
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
619 |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
620 " More tests for 'errorformat' |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
621 function! Test_efm1() |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
622 if !has('unix') |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
623 " The 'errorformat' setting is different on non-Unix systems. |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
624 " This test works only on Unix-like systems. |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
625 return |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
626 endif |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
627 |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
628 let l = [ |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
629 \ '"Xtestfile", line 4.12: 1506-045 (S) Undeclared identifier fd_set.', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
630 \ '"Xtestfile", line 6 col 19; this is an error', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
631 \ 'gcc -c -DHAVE_CONFIsing-prototypes -I/usr/X11R6/include version.c', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
632 \ 'Xtestfile:9: parse error before `asd''', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
633 \ 'make: *** [vim] Error 1', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
634 \ 'in file "Xtestfile" linenr 10: there is an error', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
635 \ '', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
636 \ '2 returned', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
637 \ '"Xtestfile", line 11 col 1; this is an error', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
638 \ '"Xtestfile", line 12 col 2; this is another error', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
639 \ '"Xtestfile", line 14:10; this is an error in column 10', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
640 \ '=Xtestfile=, line 15:10; this is another error, but in vcol 10 this time', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
641 \ '"Xtestfile", linenr 16: yet another problem', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
642 \ 'Error in "Xtestfile" at line 17:', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
643 \ 'x should be a dot', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
644 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 17', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
645 \ ' ^', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
646 \ 'Error in "Xtestfile" at line 18:', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
647 \ 'x should be a dot', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
648 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 18', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
649 \ '.............^', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
650 \ 'Error in "Xtestfile" at line 19:', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
651 \ 'x should be a dot', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
652 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 19', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
653 \ '--------------^', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
654 \ 'Error in "Xtestfile" at line 20:', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
655 \ 'x should be a dot', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
656 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 20', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
657 \ ' ^', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
658 \ '', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
659 \ 'Does anyone know what is the problem and how to correction it?', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
660 \ '"Xtestfile", line 21 col 9: What is the title of the quickfix window?', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
661 \ '"Xtestfile", line 22 col 9: What is the title of the quickfix window?' |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
662 \ ] |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
663 |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
664 call writefile(l, 'Xerrorfile1') |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
665 call writefile(l[:-2], 'Xerrorfile2') |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
666 |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
667 let m = [ |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
668 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 2', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
669 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 3', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
670 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 4', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
671 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 5', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
672 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 6', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
673 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 7', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
674 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 8', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
675 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 9', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
676 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 10', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
677 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 11', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
678 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 12', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
679 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 13', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
680 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 14', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
681 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 15', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
682 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 16', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
683 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 17', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
684 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 18', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
685 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 19', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
686 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 20', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
687 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 21', |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
688 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 22' |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
689 \ ] |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
690 call writefile(m, 'Xtestfile') |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
691 |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
692 let save_efm = &efm |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
693 set efm+==%f=\\,\ line\ %l%*\\D%v%*[^\ ]\ %m |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
694 set efm^=%AError\ in\ \"%f\"\ at\ line\ %l:,%Z%p^,%C%m |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
695 |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
696 exe 'cf Xerrorfile2' |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
697 clast |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
698 copen |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
699 call assert_equal(':cf Xerrorfile2', w:quickfix_title) |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
700 wincmd p |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
701 |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
702 exe 'cf Xerrorfile1' |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
703 call assert_equal([4, 12], [line('.'), col('.')]) |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
704 cn |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
705 call assert_equal([6, 19], [line('.'), col('.')]) |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
706 cn |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
707 call assert_equal([9, 2], [line('.'), col('.')]) |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
708 cn |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
709 call assert_equal([10, 2], [line('.'), col('.')]) |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
710 cn |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
711 call assert_equal([11, 1], [line('.'), col('.')]) |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
712 cn |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
713 call assert_equal([12, 2], [line('.'), col('.')]) |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
714 cn |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
715 call assert_equal([14, 10], [line('.'), col('.')]) |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
716 cn |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
717 call assert_equal([15, 3, 10], [line('.'), col('.'), virtcol('.')]) |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
718 cn |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
719 call assert_equal([16, 2], [line('.'), col('.')]) |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
720 cn |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
721 call assert_equal([17, 6], [line('.'), col('.')]) |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
722 cn |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
723 call assert_equal([18, 7], [line('.'), col('.')]) |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
724 cn |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
725 call assert_equal([19, 8], [line('.'), col('.')]) |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
726 cn |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
727 call assert_equal([20, 9], [line('.'), col('.')]) |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
728 clast |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
729 cprev |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
730 cprev |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
731 wincmd w |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
732 call assert_equal(':cf Xerrorfile1', w:quickfix_title) |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
733 wincmd p |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
734 |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
735 let &efm = save_efm |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
736 call delete('Xerrorfile1') |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
737 call delete('Xerrorfile2') |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
738 call delete('Xtestfile') |
ec78ecf15de7
commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents:
8605
diff
changeset
|
739 endfunction |
8702
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
740 |
9309
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
741 " Test for quickfix directory stack support |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
742 function! s:dir_stack_tests(cchar) |
9334
674f9e3ccd1a
commit https://github.com/vim/vim/commit/38df43bd13a2498cc96b3ddd9a20dd75126bd171
Christian Brabandt <cb@256bit.org>
parents:
9317
diff
changeset
|
743 call s:setup_commands(a:cchar) |
674f9e3ccd1a
commit https://github.com/vim/vim/commit/38df43bd13a2498cc96b3ddd9a20dd75126bd171
Christian Brabandt <cb@256bit.org>
parents:
9317
diff
changeset
|
744 |
9309
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
745 let save_efm=&efm |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
746 set efm=%DEntering\ dir\ '%f',%f:%l:%m,%XLeaving\ dir\ '%f' |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
747 |
9397
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
748 let lines = ["Entering dir 'dir1/a'", |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
749 \ 'habits2.txt:1:Nine Healthy Habits', |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
750 \ "Entering dir 'b'", |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
751 \ 'habits3.txt:2:0 Hours of television', |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
752 \ 'habits2.txt:7:5 Small meals', |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
753 \ "Entering dir 'dir1/c'", |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
754 \ 'habits4.txt:3:1 Hour of exercise', |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
755 \ "Leaving dir 'dir1/c'", |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
756 \ "Leaving dir 'dir1/a'", |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
757 \ 'habits1.txt:4:2 Liters of water', |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
758 \ "Entering dir 'dir2'", |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
759 \ 'habits5.txt:5:3 Cups of hot green tea', |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
760 \ "Leaving dir 'dir2'" |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
761 \] |
9309
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
762 |
9397
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
763 Xexpr "" |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
764 for l in lines |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
765 Xaddexpr l |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
766 endfor |
9309
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
767 |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
768 let qf = g:Xgetlist() |
9309
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
769 |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
770 call assert_equal('dir1/a/habits2.txt', bufname(qf[1].bufnr)) |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
771 call assert_equal(1, qf[1].lnum) |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
772 call assert_equal('dir1/a/b/habits3.txt', bufname(qf[3].bufnr)) |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
773 call assert_equal(2, qf[3].lnum) |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
774 call assert_equal('dir1/a/habits2.txt', bufname(qf[4].bufnr)) |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
775 call assert_equal(7, qf[4].lnum) |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
776 call assert_equal('dir1/c/habits4.txt', bufname(qf[6].bufnr)) |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
777 call assert_equal(3, qf[6].lnum) |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
778 call assert_equal('habits1.txt', bufname(qf[9].bufnr)) |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
779 call assert_equal(4, qf[9].lnum) |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
780 call assert_equal('dir2/habits5.txt', bufname(qf[11].bufnr)) |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
781 call assert_equal(5, qf[11].lnum) |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
782 |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
783 let &efm=save_efm |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
784 endfunction |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
785 |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
786 " Tests for %D and %X errorformat options |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
787 function! Test_efm_dirstack() |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
788 " Create the directory stack and files |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
789 call mkdir('dir1') |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
790 call mkdir('dir1/a') |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
791 call mkdir('dir1/a/b') |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
792 call mkdir('dir1/c') |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
793 call mkdir('dir2') |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
794 |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
795 let lines = ["Nine Healthy Habits", |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
796 \ "0 Hours of television", |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
797 \ "1 Hour of exercise", |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
798 \ "2 Liters of water", |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
799 \ "3 Cups of hot green tea", |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
800 \ "4 Short mental breaks", |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
801 \ "5 Small meals", |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
802 \ "6 AM wake up time", |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
803 \ "7 Minutes of laughter", |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
804 \ "8 Hours of sleep (at least)", |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
805 \ "9 PM end of the day and off to bed" |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
806 \ ] |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
807 call writefile(lines, 'habits1.txt') |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
808 call writefile(lines, 'dir1/a/habits2.txt') |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
809 call writefile(lines, 'dir1/a/b/habits3.txt') |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
810 call writefile(lines, 'dir1/c/habits4.txt') |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
811 call writefile(lines, 'dir2/habits5.txt') |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
812 |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
813 call s:dir_stack_tests('c') |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
814 call s:dir_stack_tests('l') |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
815 |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
816 call delete('dir1', 'rf') |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
817 call delete('dir2', 'rf') |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
818 call delete('habits1.txt') |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
819 endfunction |
178252c6850e
commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents:
9258
diff
changeset
|
820 |
10257
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
821 " Test for resync after continuing an ignored message |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
822 function! Xefm_ignore_continuations(cchar) |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
823 call s:setup_commands(a:cchar) |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
824 |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
825 let save_efm = &efm |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
826 |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
827 let &efm = |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
828 \ '%Eerror %m %l,' . |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
829 \ '%-Wignored %m %l,' . |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
830 \ '%+Cmore ignored %m %l,' . |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
831 \ '%Zignored end' |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
832 Xgetexpr ['ignored warning 1', 'more ignored continuation 2', 'ignored end', 'error resync 4'] |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
833 let l = map(g:Xgetlist(), '[v:val.text, v:val.valid, v:val.lnum, v:val.type]') |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
834 call assert_equal([['resync', 1, 4, 'E']], l) |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
835 |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
836 let &efm = save_efm |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
837 endfunction |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
838 |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
839 function! Test_efm_ignore_continuations() |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
840 call Xefm_ignore_continuations('c') |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
841 call Xefm_ignore_continuations('l') |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
842 endfunction |
2d0e6034743a
commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents:
10237
diff
changeset
|
843 |
9405
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
844 " Tests for invalid error format specifies |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
845 function Xinvalid_efm_Tests(cchar) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
846 call s:setup_commands(a:cchar) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
847 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
848 let save_efm = &efm |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
849 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
850 set efm=%f:%l:%m,%f:%f:%l:%m |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
851 call assert_fails('Xexpr "abc.txt:1:Hello world"', 'E372:') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
852 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
853 set efm=%f:%l:%m,%f:%l:%r:%m |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
854 call assert_fails('Xexpr "abc.txt:1:Hello world"', 'E373:') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
855 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
856 set efm=%f:%l:%m,%O:%f:%l:%m |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
857 call assert_fails('Xexpr "abc.txt:1:Hello world"', 'E373:') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
858 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
859 set efm=%f:%l:%m,%f:%l:%*[^a-z |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
860 call assert_fails('Xexpr "abc.txt:1:Hello world"', 'E374:') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
861 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
862 set efm=%f:%l:%m,%f:%l:%*c |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
863 call assert_fails('Xexpr "abc.txt:1:Hello world"', 'E375:') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
864 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
865 set efm=%f:%l:%m,%L%M%N |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
866 call assert_fails('Xexpr "abc.txt:1:Hello world"', 'E376:') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
867 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
868 set efm=%f:%l:%m,%f:%l:%m:%R |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
869 call assert_fails('Xexpr "abc.txt:1:Hello world"', 'E377:') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
870 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
871 set efm= |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
872 call assert_fails('Xexpr "abc.txt:1:Hello world"', 'E378:') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
873 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
874 set efm=%DEntering\ dir\ abc,%f:%l:%m |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
875 call assert_fails('Xexpr ["Entering dir abc", "abc.txt:1:Hello world"]', 'E379:') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
876 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
877 let &efm = save_efm |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
878 endfunction |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
879 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
880 function Test_invalid_efm() |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
881 call Xinvalid_efm_Tests('c') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
882 call Xinvalid_efm_Tests('l') |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
883 endfunction |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
884 |
9342
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
885 " TODO: |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
886 " Add tests for the following formats in 'errorformat' |
9405
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
887 " %r %O |
9342
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
888 function! Test_efm2() |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
889 let save_efm = &efm |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
890 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
891 " Test for %s format in efm |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
892 set efm=%f:%s |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
893 cexpr 'Xtestfile:Line search text' |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
894 let l = getqflist() |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
895 call assert_equal(l[0].pattern, '^\VLine search text\$') |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
896 call assert_equal(l[0].lnum, 0) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
897 |
9405
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
898 " Test for %P, %Q and %t format specifiers |
9342
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
899 let lines=["[Xtestfile1]", |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
900 \ "(1,17) error: ';' missing", |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
901 \ "(21,2) warning: variable 'z' not defined", |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
902 \ "(67,3) error: end of file found before string ended", |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
903 \ "", |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
904 \ "[Xtestfile2]", |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
905 \ "", |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
906 \ "[Xtestfile3]", |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
907 \ "NEW compiler v1.1", |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
908 \ "(2,2) warning: variable 'x' not defined", |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
909 \ "(67,3) warning: 's' already defined" |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
910 \] |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
911 set efm=%+P[%f],(%l\\,%c)%*[\ ]%t%*[^:]:\ %m,%-Q |
9397
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
912 cexpr "" |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
913 for l in lines |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
914 caddexpr l |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
915 endfor |
9342
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
916 let l = getqflist() |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
917 call assert_equal(9, len(l)) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
918 call assert_equal(21, l[2].lnum) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
919 call assert_equal(2, l[2].col) |
9405
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
920 call assert_equal('w', l[2].type) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
921 call assert_equal('e', l[3].type) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
922 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
923 " Tests for %E, %C and %Z format specifiers |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
924 let lines = ["Error 275", |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
925 \ "line 42", |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
926 \ "column 3", |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
927 \ "' ' expected after '--'" |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
928 \] |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
929 set efm=%EError\ %n,%Cline\ %l,%Ccolumn\ %c,%Z%m |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
930 cgetexpr lines |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
931 let l = getqflist() |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
932 call assert_equal(275, l[0].nr) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
933 call assert_equal(42, l[0].lnum) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
934 call assert_equal(3, l[0].col) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
935 call assert_equal('E', l[0].type) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
936 call assert_equal("\n' ' expected after '--'", l[0].text) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
937 |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
938 " Test for %> |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
939 let lines = ["Error in line 147 of foo.c:", |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
940 \"unknown variable 'i'" |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
941 \] |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
942 set efm=unknown\ variable\ %m,%E%>Error\ in\ line\ %l\ of\ %f:,%Z%m |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
943 cgetexpr lines |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
944 let l = getqflist() |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
945 call assert_equal(147, l[0].lnum) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
946 call assert_equal('E', l[0].type) |
2ce9814053d8
commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents:
9397
diff
changeset
|
947 call assert_equal("\nunknown variable 'i'", l[0].text) |
9342
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
948 |
9568
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
949 " Test for %A, %C and other formats |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
950 let lines = [ |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
951 \"==============================================================", |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
952 \"FAIL: testGetTypeIdCachesResult (dbfacadeTest.DjsDBFacadeTest)", |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
953 \"--------------------------------------------------------------", |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
954 \"Traceback (most recent call last):", |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
955 \' File "unittests/dbfacadeTest.py", line 89, in testFoo', |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
956 \" self.assertEquals(34, dtid)", |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
957 \' File "/usr/lib/python2.2/unittest.py", line 286, in', |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
958 \" failUnlessEqual", |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
959 \" raise self.failureException, \\", |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
960 \"AssertionError: 34 != 33", |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
961 \"", |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
962 \"--------------------------------------------------------------", |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
963 \"Ran 27 tests in 0.063s" |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
964 \] |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
965 set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
966 cgetexpr lines |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
967 let l = getqflist() |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
968 call assert_equal(8, len(l)) |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
969 call assert_equal(89, l[4].lnum) |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
970 call assert_equal(1, l[4].valid) |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
971 call assert_equal('unittests/dbfacadeTest.py', bufname(l[4].bufnr)) |
ccbd2e604e59
commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents:
9540
diff
changeset
|
972 |
9342
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
973 let &efm = save_efm |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
974 endfunction |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
975 |
8702
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
976 function XquickfixChangedByAutocmd(cchar) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
977 call s:setup_commands(a:cchar) |
8702
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
978 if a:cchar == 'c' |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
979 let ErrorNr = 'E925' |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
980 function! ReadFunc() |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
981 colder |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
982 cgetexpr [] |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
983 endfunc |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
984 else |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
985 let ErrorNr = 'E926' |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
986 function! ReadFunc() |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
987 lolder |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
988 lgetexpr [] |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
989 endfunc |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
990 endif |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
991 |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
992 augroup testgroup |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
993 au! |
8965
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
994 autocmd BufReadCmd test_changed.txt call ReadFunc() |
8702
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
995 augroup END |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
996 |
8965
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
997 new | only |
8702
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
998 let words = [ "a", "b" ] |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
999 let qflist = [] |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
1000 for word in words |
8965
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1001 call add(qflist, {'filename': 'test_changed.txt'}) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1002 call g:Xsetlist(qflist, ' ') |
8702
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
1003 endfor |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1004 call assert_fails('Xrewind', ErrorNr . ':') |
8702
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
1005 |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
1006 augroup! testgroup |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
1007 endfunc |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
1008 |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
1009 function Test_quickfix_was_changed_by_autocmd() |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
1010 call XquickfixChangedByAutocmd('c') |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
1011 call XquickfixChangedByAutocmd('l') |
39d6e4f2f748
commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents:
8649
diff
changeset
|
1012 endfunction |
8716
4ce26276caeb
commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071
Christian Brabandt <cb@256bit.org>
parents:
8702
diff
changeset
|
1013 |
4ce26276caeb
commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071
Christian Brabandt <cb@256bit.org>
parents:
8702
diff
changeset
|
1014 func Test_caddbuffer_to_empty() |
4ce26276caeb
commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071
Christian Brabandt <cb@256bit.org>
parents:
8702
diff
changeset
|
1015 helpgr quickfix |
4ce26276caeb
commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071
Christian Brabandt <cb@256bit.org>
parents:
8702
diff
changeset
|
1016 call setqflist([], 'r') |
4ce26276caeb
commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071
Christian Brabandt <cb@256bit.org>
parents:
8702
diff
changeset
|
1017 cad |
8722
ecb57048c2a8
commit https://github.com/vim/vim/commit/f68f1d70799631d38461c36cd59d08cf839b010d
Christian Brabandt <cb@256bit.org>
parents:
8716
diff
changeset
|
1018 try |
ecb57048c2a8
commit https://github.com/vim/vim/commit/f68f1d70799631d38461c36cd59d08cf839b010d
Christian Brabandt <cb@256bit.org>
parents:
8716
diff
changeset
|
1019 cn |
ecb57048c2a8
commit https://github.com/vim/vim/commit/f68f1d70799631d38461c36cd59d08cf839b010d
Christian Brabandt <cb@256bit.org>
parents:
8716
diff
changeset
|
1020 catch |
ecb57048c2a8
commit https://github.com/vim/vim/commit/f68f1d70799631d38461c36cd59d08cf839b010d
Christian Brabandt <cb@256bit.org>
parents:
8716
diff
changeset
|
1021 " number of matches is unknown |
ecb57048c2a8
commit https://github.com/vim/vim/commit/f68f1d70799631d38461c36cd59d08cf839b010d
Christian Brabandt <cb@256bit.org>
parents:
8716
diff
changeset
|
1022 call assert_true(v:exception =~ 'E553:') |
ecb57048c2a8
commit https://github.com/vim/vim/commit/f68f1d70799631d38461c36cd59d08cf839b010d
Christian Brabandt <cb@256bit.org>
parents:
8716
diff
changeset
|
1023 endtry |
8716
4ce26276caeb
commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071
Christian Brabandt <cb@256bit.org>
parents:
8702
diff
changeset
|
1024 quit! |
4ce26276caeb
commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071
Christian Brabandt <cb@256bit.org>
parents:
8702
diff
changeset
|
1025 endfunc |
8751
7f974075eb8f
commit https://github.com/vim/vim/commit/89c64d557dbe0bacfdd7b2872411b00cc1523d85
Christian Brabandt <cb@256bit.org>
parents:
8722
diff
changeset
|
1026 |
7f974075eb8f
commit https://github.com/vim/vim/commit/89c64d557dbe0bacfdd7b2872411b00cc1523d85
Christian Brabandt <cb@256bit.org>
parents:
8722
diff
changeset
|
1027 func Test_cgetexpr_works() |
7f974075eb8f
commit https://github.com/vim/vim/commit/89c64d557dbe0bacfdd7b2872411b00cc1523d85
Christian Brabandt <cb@256bit.org>
parents:
8722
diff
changeset
|
1028 " this must not crash Vim |
7f974075eb8f
commit https://github.com/vim/vim/commit/89c64d557dbe0bacfdd7b2872411b00cc1523d85
Christian Brabandt <cb@256bit.org>
parents:
8722
diff
changeset
|
1029 cgetexpr [$x] |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1030 lgetexpr [$x] |
8751
7f974075eb8f
commit https://github.com/vim/vim/commit/89c64d557dbe0bacfdd7b2872411b00cc1523d85
Christian Brabandt <cb@256bit.org>
parents:
8722
diff
changeset
|
1031 endfunc |
8932
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1032 |
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1033 " Tests for the setqflist() and setloclist() functions |
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1034 function SetXlistTests(cchar, bnum) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1035 call s:setup_commands(a:cchar) |
8932
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1036 |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1037 call g:Xsetlist([{'bufnr': a:bnum, 'lnum': 1}, |
8932
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1038 \ {'bufnr': a:bnum, 'lnum': 2}]) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1039 let l = g:Xgetlist() |
8932
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1040 call assert_equal(2, len(l)) |
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1041 call assert_equal(2, l[1].lnum) |
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1042 |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1043 Xnext |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1044 call g:Xsetlist([{'bufnr': a:bnum, 'lnum': 3}], 'a') |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1045 let l = g:Xgetlist() |
8932
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1046 call assert_equal(3, len(l)) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1047 Xnext |
8932
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1048 call assert_equal(3, line('.')) |
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1049 |
9114
f221aec7fcca
commit https://github.com/vim/vim/commit/2b2b8ae5ab37b04584633c469265d85825166905
Christian Brabandt <cb@256bit.org>
parents:
9033
diff
changeset
|
1050 " Appending entries to the list should not change the cursor position |
f221aec7fcca
commit https://github.com/vim/vim/commit/2b2b8ae5ab37b04584633c469265d85825166905
Christian Brabandt <cb@256bit.org>
parents:
9033
diff
changeset
|
1051 " in the quickfix window |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1052 Xwindow |
9114
f221aec7fcca
commit https://github.com/vim/vim/commit/2b2b8ae5ab37b04584633c469265d85825166905
Christian Brabandt <cb@256bit.org>
parents:
9033
diff
changeset
|
1053 1 |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1054 call g:Xsetlist([{'bufnr': a:bnum, 'lnum': 4}, |
9114
f221aec7fcca
commit https://github.com/vim/vim/commit/2b2b8ae5ab37b04584633c469265d85825166905
Christian Brabandt <cb@256bit.org>
parents:
9033
diff
changeset
|
1055 \ {'bufnr': a:bnum, 'lnum': 5}], 'a') |
f221aec7fcca
commit https://github.com/vim/vim/commit/2b2b8ae5ab37b04584633c469265d85825166905
Christian Brabandt <cb@256bit.org>
parents:
9033
diff
changeset
|
1056 call assert_equal(1, line('.')) |
f221aec7fcca
commit https://github.com/vim/vim/commit/2b2b8ae5ab37b04584633c469265d85825166905
Christian Brabandt <cb@256bit.org>
parents:
9033
diff
changeset
|
1057 close |
f221aec7fcca
commit https://github.com/vim/vim/commit/2b2b8ae5ab37b04584633c469265d85825166905
Christian Brabandt <cb@256bit.org>
parents:
9033
diff
changeset
|
1058 |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1059 call g:Xsetlist([{'bufnr': a:bnum, 'lnum': 3}, |
8932
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1060 \ {'bufnr': a:bnum, 'lnum': 4}, |
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1061 \ {'bufnr': a:bnum, 'lnum': 5}], 'r') |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1062 let l = g:Xgetlist() |
8932
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1063 call assert_equal(3, len(l)) |
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1064 call assert_equal(5, l[2].lnum) |
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1065 |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1066 call g:Xsetlist([]) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1067 let l = g:Xgetlist() |
8932
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1068 call assert_equal(0, len(l)) |
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1069 endfunction |
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1070 |
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1071 function Test_setqflist() |
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1072 new Xtestfile | only |
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1073 let bnum = bufnr('%') |
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1074 call setline(1, range(1,5)) |
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1075 |
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1076 call SetXlistTests('c', bnum) |
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1077 call SetXlistTests('l', bnum) |
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1078 |
9258
7e403edce82f
commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents:
9121
diff
changeset
|
1079 enew! |
8932
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1080 call delete('Xtestfile') |
25c2031e9f9f
commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents:
8751
diff
changeset
|
1081 endfunction |
8965
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1082 |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1083 function Xlist_empty_middle(cchar) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1084 call s:setup_commands(a:cchar) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1085 |
9258
7e403edce82f
commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents:
9121
diff
changeset
|
1086 " create three quickfix lists |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1087 Xvimgrep Test_ test_quickfix.vim |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1088 let testlen = len(g:Xgetlist()) |
9258
7e403edce82f
commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents:
9121
diff
changeset
|
1089 call assert_true(testlen > 0) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1090 Xvimgrep empty test_quickfix.vim |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1091 call assert_true(len(g:Xgetlist()) > 0) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1092 Xvimgrep matches test_quickfix.vim |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1093 let matchlen = len(g:Xgetlist()) |
9258
7e403edce82f
commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents:
9121
diff
changeset
|
1094 call assert_true(matchlen > 0) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1095 Xolder |
9258
7e403edce82f
commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents:
9121
diff
changeset
|
1096 " make the middle list empty |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1097 call g:Xsetlist([], 'r') |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1098 call assert_true(len(g:Xgetlist()) == 0) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1099 Xolder |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1100 call assert_equal(testlen, len(g:Xgetlist())) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1101 Xnewer |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1102 Xnewer |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1103 call assert_equal(matchlen, len(g:Xgetlist())) |
9258
7e403edce82f
commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents:
9121
diff
changeset
|
1104 endfunc |
7e403edce82f
commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents:
9121
diff
changeset
|
1105 |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1106 function Test_setqflist_empty_middle() |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1107 call Xlist_empty_middle('c') |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1108 call Xlist_empty_middle('l') |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1109 endfunction |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1110 |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1111 function Xlist_empty_older(cchar) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1112 call s:setup_commands(a:cchar) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1113 |
9258
7e403edce82f
commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents:
9121
diff
changeset
|
1114 " create three quickfix lists |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1115 Xvimgrep one test_quickfix.vim |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1116 let onelen = len(g:Xgetlist()) |
9258
7e403edce82f
commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents:
9121
diff
changeset
|
1117 call assert_true(onelen > 0) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1118 Xvimgrep two test_quickfix.vim |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1119 let twolen = len(g:Xgetlist()) |
9258
7e403edce82f
commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents:
9121
diff
changeset
|
1120 call assert_true(twolen > 0) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1121 Xvimgrep three test_quickfix.vim |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1122 let threelen = len(g:Xgetlist()) |
9258
7e403edce82f
commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents:
9121
diff
changeset
|
1123 call assert_true(threelen > 0) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1124 Xolder 2 |
9258
7e403edce82f
commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents:
9121
diff
changeset
|
1125 " make the first list empty, check the others didn't change |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1126 call g:Xsetlist([], 'r') |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1127 call assert_true(len(g:Xgetlist()) == 0) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1128 Xnewer |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1129 call assert_equal(twolen, len(g:Xgetlist())) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1130 Xnewer |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1131 call assert_equal(threelen, len(g:Xgetlist())) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1132 endfunction |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1133 |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1134 function Test_setqflist_empty_older() |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1135 call Xlist_empty_older('c') |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1136 call Xlist_empty_older('l') |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1137 endfunction |
9258
7e403edce82f
commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents:
9121
diff
changeset
|
1138 |
8965
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1139 function! XquickfixSetListWithAct(cchar) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1140 call s:setup_commands(a:cchar) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1141 |
8965
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1142 let list1 = [{'filename': 'fnameA', 'text': 'A'}, |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1143 \ {'filename': 'fnameB', 'text': 'B'}] |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1144 let list2 = [{'filename': 'fnameC', 'text': 'C'}, |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1145 \ {'filename': 'fnameD', 'text': 'D'}, |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1146 \ {'filename': 'fnameE', 'text': 'E'}] |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1147 |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1148 " {action} is unspecified. Same as specifing ' '. |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1149 new | only |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1150 silent! Xnewer 99 |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1151 call g:Xsetlist(list1) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1152 call g:Xsetlist(list2) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1153 let li = g:Xgetlist() |
8965
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1154 call assert_equal(3, len(li)) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1155 call assert_equal('C', li[0]['text']) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1156 call assert_equal('D', li[1]['text']) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1157 call assert_equal('E', li[2]['text']) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1158 silent! Xolder |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1159 let li = g:Xgetlist() |
8965
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1160 call assert_equal(2, len(li)) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1161 call assert_equal('A', li[0]['text']) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1162 call assert_equal('B', li[1]['text']) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1163 |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1164 " {action} is specified ' '. |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1165 new | only |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1166 silent! Xnewer 99 |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1167 call g:Xsetlist(list1) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1168 call g:Xsetlist(list2, ' ') |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1169 let li = g:Xgetlist() |
8965
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1170 call assert_equal(3, len(li)) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1171 call assert_equal('C', li[0]['text']) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1172 call assert_equal('D', li[1]['text']) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1173 call assert_equal('E', li[2]['text']) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1174 silent! Xolder |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1175 let li = g:Xgetlist() |
8965
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1176 call assert_equal(2, len(li)) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1177 call assert_equal('A', li[0]['text']) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1178 call assert_equal('B', li[1]['text']) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1179 |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1180 " {action} is specified 'a'. |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1181 new | only |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1182 silent! Xnewer 99 |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1183 call g:Xsetlist(list1) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1184 call g:Xsetlist(list2, 'a') |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1185 let li = g:Xgetlist() |
8965
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1186 call assert_equal(5, len(li)) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1187 call assert_equal('A', li[0]['text']) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1188 call assert_equal('B', li[1]['text']) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1189 call assert_equal('C', li[2]['text']) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1190 call assert_equal('D', li[3]['text']) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1191 call assert_equal('E', li[4]['text']) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1192 |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1193 " {action} is specified 'r'. |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1194 new | only |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1195 silent! Xnewer 99 |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1196 call g:Xsetlist(list1) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1197 call g:Xsetlist(list2, 'r') |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1198 let li = g:Xgetlist() |
8965
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1199 call assert_equal(3, len(li)) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1200 call assert_equal('C', li[0]['text']) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1201 call assert_equal('D', li[1]['text']) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1202 call assert_equal('E', li[2]['text']) |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1203 |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1204 " Test for wrong value. |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1205 new | only |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1206 call assert_fails("call g:Xsetlist(0)", 'E714:') |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1207 call assert_fails("call g:Xsetlist(list1, '')", 'E927:') |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1208 call assert_fails("call g:Xsetlist(list1, 'aa')", 'E927:') |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1209 call assert_fails("call g:Xsetlist(list1, ' a')", 'E927:') |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1210 call assert_fails("call g:Xsetlist(list1, 0)", 'E928:') |
8965
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1211 endfunc |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1212 |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1213 function Test_quickfix_set_list_with_act() |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1214 call XquickfixSetListWithAct('c') |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1215 call XquickfixSetListWithAct('l') |
90f7dc794aa0
commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents:
8932
diff
changeset
|
1216 endfunction |
9033
0536d1469b67
commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents:
8965
diff
changeset
|
1217 |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1218 function XLongLinesTests(cchar) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1219 let l = g:Xgetlist() |
9033
0536d1469b67
commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents:
8965
diff
changeset
|
1220 |
9342
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1221 call assert_equal(4, len(l)) |
9033
0536d1469b67
commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents:
8965
diff
changeset
|
1222 call assert_equal(1, l[0].lnum) |
0536d1469b67
commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents:
8965
diff
changeset
|
1223 call assert_equal(1, l[0].col) |
9342
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1224 call assert_equal(1975, len(l[0].text)) |
9033
0536d1469b67
commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents:
8965
diff
changeset
|
1225 call assert_equal(2, l[1].lnum) |
0536d1469b67
commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents:
8965
diff
changeset
|
1226 call assert_equal(1, l[1].col) |
0536d1469b67
commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents:
8965
diff
changeset
|
1227 call assert_equal(4070, len(l[1].text)) |
0536d1469b67
commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents:
8965
diff
changeset
|
1228 call assert_equal(3, l[2].lnum) |
0536d1469b67
commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents:
8965
diff
changeset
|
1229 call assert_equal(1, l[2].col) |
9342
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1230 call assert_equal(4070, len(l[2].text)) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1231 call assert_equal(4, l[3].lnum) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1232 call assert_equal(1, l[3].col) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1233 call assert_equal(10, len(l[3].text)) |
9033
0536d1469b67
commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents:
8965
diff
changeset
|
1234 |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1235 call g:Xsetlist([], 'r') |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1236 endfunction |
9033
0536d1469b67
commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents:
8965
diff
changeset
|
1237 |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1238 function s:long_lines_tests(cchar) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1239 call s:setup_commands(a:cchar) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1240 |
9033
0536d1469b67
commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents:
8965
diff
changeset
|
1241 let testfile = 'samples/quickfix.txt' |
0536d1469b67
commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents:
8965
diff
changeset
|
1242 |
0536d1469b67
commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents:
8965
diff
changeset
|
1243 " file |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1244 exe 'Xgetfile' testfile |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1245 call XLongLinesTests(a:cchar) |
9033
0536d1469b67
commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents:
8965
diff
changeset
|
1246 |
0536d1469b67
commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents:
8965
diff
changeset
|
1247 " list |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1248 Xexpr readfile(testfile) |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1249 call XLongLinesTests(a:cchar) |
9033
0536d1469b67
commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents:
8965
diff
changeset
|
1250 |
0536d1469b67
commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents:
8965
diff
changeset
|
1251 " string |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1252 Xexpr join(readfile(testfile), "\n") |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1253 call XLongLinesTests(a:cchar) |
9033
0536d1469b67
commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents:
8965
diff
changeset
|
1254 |
0536d1469b67
commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents:
8965
diff
changeset
|
1255 " buffer |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1256 exe 'edit' testfile |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1257 exe 'Xbuffer' bufnr('%') |
9336
52bda0e40ea2
commit https://github.com/vim/vim/commit/f50df3925b7c909d1cda4c868d8c7ba38189aabe
Christian Brabandt <cb@256bit.org>
parents:
9334
diff
changeset
|
1258 call XLongLinesTests(a:cchar) |
9317
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1259 endfunction |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1260 |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1261 function Test_long_lines() |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1262 call s:long_lines_tests('c') |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1263 call s:long_lines_tests('l') |
fa3f71185144
commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents:
9309
diff
changeset
|
1264 endfunction |
9342
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1265 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1266 function! s:create_test_file(filename) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1267 let l = [] |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1268 for i in range(1, 20) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1269 call add(l, 'Line' . i) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1270 endfor |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1271 call writefile(l, a:filename) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1272 endfunction |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1273 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1274 function! Test_switchbuf() |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1275 call s:create_test_file('Xqftestfile1') |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1276 call s:create_test_file('Xqftestfile2') |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1277 call s:create_test_file('Xqftestfile3') |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1278 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1279 new | only |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1280 edit Xqftestfile1 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1281 let file1_winid = win_getid() |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1282 new Xqftestfile2 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1283 let file2_winid = win_getid() |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1284 cgetexpr ['Xqftestfile1:5:Line5', |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1285 \ 'Xqftestfile1:6:Line6', |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1286 \ 'Xqftestfile2:10:Line10', |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1287 \ 'Xqftestfile2:11:Line11', |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1288 \ 'Xqftestfile3:15:Line15', |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1289 \ 'Xqftestfile3:16:Line16'] |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1290 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1291 new |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1292 let winid = win_getid() |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1293 cfirst | cnext |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1294 call assert_equal(winid, win_getid()) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1295 cnext | cnext |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1296 call assert_equal(winid, win_getid()) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1297 cnext | cnext |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1298 call assert_equal(winid, win_getid()) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1299 enew |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1300 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1301 set switchbuf=useopen |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1302 cfirst | cnext |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1303 call assert_equal(file1_winid, win_getid()) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1304 cnext | cnext |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1305 call assert_equal(file2_winid, win_getid()) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1306 cnext | cnext |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1307 call assert_equal(file2_winid, win_getid()) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1308 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1309 enew | only |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1310 set switchbuf=usetab |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1311 tabedit Xqftestfile1 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1312 tabedit Xqftestfile2 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1313 tabfirst |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1314 cfirst | cnext |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1315 call assert_equal(2, tabpagenr()) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1316 cnext | cnext |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1317 call assert_equal(3, tabpagenr()) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1318 cnext | cnext |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1319 call assert_equal(3, tabpagenr()) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1320 tabfirst | tabonly | enew |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1321 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1322 set switchbuf=split |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1323 cfirst | cnext |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1324 call assert_equal(1, winnr('$')) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1325 cnext | cnext |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1326 call assert_equal(2, winnr('$')) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1327 cnext | cnext |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1328 call assert_equal(3, winnr('$')) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1329 enew | only |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1330 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1331 set switchbuf=newtab |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1332 cfirst | cnext |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1333 call assert_equal(1, tabpagenr('$')) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1334 cnext | cnext |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1335 call assert_equal(2, tabpagenr('$')) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1336 cnext | cnext |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1337 call assert_equal(3, tabpagenr('$')) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1338 tabfirst | enew | tabonly | only |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1339 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1340 set switchbuf= |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1341 edit Xqftestfile1 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1342 let file1_winid = win_getid() |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1343 new Xqftestfile2 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1344 let file2_winid = win_getid() |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1345 copen |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1346 exe "normal 1G\<CR>" |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1347 call assert_equal(file1_winid, win_getid()) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1348 copen |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1349 exe "normal 3G\<CR>" |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1350 call assert_equal(file2_winid, win_getid()) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1351 copen | only |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1352 exe "normal 5G\<CR>" |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1353 call assert_equal(2, winnr('$')) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1354 call assert_equal(1, bufwinnr('Xqftestfile3')) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1355 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1356 enew | only |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1357 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1358 call delete('Xqftestfile1') |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1359 call delete('Xqftestfile2') |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1360 call delete('Xqftestfile3') |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1361 endfunction |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1362 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1363 function! Xadjust_qflnum(cchar) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1364 call s:setup_commands(a:cchar) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1365 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1366 enew | only |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1367 |
9608
fa64afb99dda
commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents:
9568
diff
changeset
|
1368 let fname = 'Xqftestfile' . a:cchar |
fa64afb99dda
commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents:
9568
diff
changeset
|
1369 call s:create_test_file(fname) |
fa64afb99dda
commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents:
9568
diff
changeset
|
1370 exe 'edit ' . fname |
9342
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1371 |
9608
fa64afb99dda
commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents:
9568
diff
changeset
|
1372 Xgetexpr [fname . ':5:Line5', |
fa64afb99dda
commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents:
9568
diff
changeset
|
1373 \ fname . ':10:Line10', |
fa64afb99dda
commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents:
9568
diff
changeset
|
1374 \ fname . ':15:Line15', |
fa64afb99dda
commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents:
9568
diff
changeset
|
1375 \ fname . ':20:Line20'] |
9342
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1376 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1377 6,14delete |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1378 call append(6, ['Buffer', 'Window']) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1379 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1380 let l = g:Xgetlist() |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1381 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1382 call assert_equal(5, l[0].lnum) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1383 call assert_equal(6, l[2].lnum) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1384 call assert_equal(13, l[3].lnum) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1385 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1386 enew! |
9608
fa64afb99dda
commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents:
9568
diff
changeset
|
1387 call delete(fname) |
9342
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1388 endfunction |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1389 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1390 function! Test_adjust_lnum() |
9608
fa64afb99dda
commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents:
9568
diff
changeset
|
1391 call setloclist(0, []) |
9342
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1392 call Xadjust_qflnum('c') |
9608
fa64afb99dda
commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents:
9568
diff
changeset
|
1393 call setqflist([]) |
9342
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1394 call Xadjust_qflnum('l') |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1395 endfunction |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1396 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1397 " Tests for the :grep/:lgrep and :grepadd/:lgrepadd commands |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1398 function! s:test_xgrep(cchar) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1399 call s:setup_commands(a:cchar) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1400 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1401 " The following lines are used for the grep test. Don't remove. |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1402 " Grep_Test_Text: Match 1 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1403 " Grep_Test_Text: Match 2 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1404 " GrepAdd_Test_Text: Match 1 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1405 " GrepAdd_Test_Text: Match 2 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1406 enew! | only |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1407 set makeef&vim |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1408 silent Xgrep Grep_Test_Text: test_quickfix.vim |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1409 call assert_true(len(g:Xgetlist()) == 3) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1410 Xopen |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1411 call assert_true(w:quickfix_title =~ '^:grep') |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1412 Xclose |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1413 enew |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1414 set makeef=Temp_File_## |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1415 silent Xgrepadd GrepAdd_Test_Text: test_quickfix.vim |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1416 call assert_true(len(g:Xgetlist()) == 6) |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1417 endfunction |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1418 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1419 function! Test_grep() |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1420 if !has('unix') |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1421 " The grepprg may not be set on non-Unix systems |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1422 return |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1423 endif |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1424 |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1425 call s:test_xgrep('c') |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1426 call s:test_xgrep('l') |
8ce61744ed94
commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents:
9336
diff
changeset
|
1427 endfunction |
9397
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1428 |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1429 function! Test_two_windows() |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1430 " Use one 'errorformat' for two windows. Add an expression to each of them, |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1431 " make sure they each keep their own state. |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1432 set efm=%DEntering\ dir\ '%f',%f:%l:%m,%XLeaving\ dir\ '%f' |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1433 call mkdir('Xone/a', 'p') |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1434 call mkdir('Xtwo/a', 'p') |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1435 let lines = ['1', '2', 'one one one', '4', 'two two two', '6', '7'] |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1436 call writefile(lines, 'Xone/a/one.txt') |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1437 call writefile(lines, 'Xtwo/a/two.txt') |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1438 |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1439 new one |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1440 let one_id = win_getid() |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1441 lexpr "" |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1442 new two |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1443 let two_id = win_getid() |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1444 lexpr "" |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1445 |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1446 laddexpr "Entering dir 'Xtwo/a'" |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1447 call win_gotoid(one_id) |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1448 laddexpr "Entering dir 'Xone/a'" |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1449 call win_gotoid(two_id) |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1450 laddexpr 'two.txt:5:two two two' |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1451 call win_gotoid(one_id) |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1452 laddexpr 'one.txt:3:one one one' |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1453 |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1454 let loc_one = getloclist(one_id) |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1455 call assert_equal('Xone/a/one.txt', bufname(loc_one[1].bufnr)) |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1456 call assert_equal(3, loc_one[1].lnum) |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1457 |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1458 let loc_two = getloclist(two_id) |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1459 call assert_equal('Xtwo/a/two.txt', bufname(loc_two[1].bufnr)) |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1460 call assert_equal(5, loc_two[1].lnum) |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1461 |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1462 call win_gotoid(one_id) |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1463 bwipe! |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1464 call win_gotoid(two_id) |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1465 bwipe! |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1466 call delete('Xone', 'rf') |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1467 call delete('Xtwo', 'rf') |
e08e8b00fe48
commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents:
9342
diff
changeset
|
1468 endfunc |
9432
abb72f0b9e06
commit https://github.com/vim/vim/commit/dcb170018642ec144cd87d9d9fe076575b8d1263
Christian Brabandt <cb@256bit.org>
parents:
9405
diff
changeset
|
1469 |
9458
374afcf9d11d
commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents:
9432
diff
changeset
|
1470 function XbottomTests(cchar) |
374afcf9d11d
commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents:
9432
diff
changeset
|
1471 call s:setup_commands(a:cchar) |
374afcf9d11d
commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents:
9432
diff
changeset
|
1472 |
374afcf9d11d
commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents:
9432
diff
changeset
|
1473 call g:Xsetlist([{'filename': 'foo', 'lnum': 42}]) |
374afcf9d11d
commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents:
9432
diff
changeset
|
1474 Xopen |
9432
abb72f0b9e06
commit https://github.com/vim/vim/commit/dcb170018642ec144cd87d9d9fe076575b8d1263
Christian Brabandt <cb@256bit.org>
parents:
9405
diff
changeset
|
1475 let wid = win_getid() |
abb72f0b9e06
commit https://github.com/vim/vim/commit/dcb170018642ec144cd87d9d9fe076575b8d1263
Christian Brabandt <cb@256bit.org>
parents:
9405
diff
changeset
|
1476 call assert_equal(1, line('.')) |
abb72f0b9e06
commit https://github.com/vim/vim/commit/dcb170018642ec144cd87d9d9fe076575b8d1263
Christian Brabandt <cb@256bit.org>
parents:
9405
diff
changeset
|
1477 wincmd w |
9458
374afcf9d11d
commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents:
9432
diff
changeset
|
1478 call g:Xsetlist([{'filename': 'var', 'lnum': 24}], 'a') |
374afcf9d11d
commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents:
9432
diff
changeset
|
1479 Xbottom |
9432
abb72f0b9e06
commit https://github.com/vim/vim/commit/dcb170018642ec144cd87d9d9fe076575b8d1263
Christian Brabandt <cb@256bit.org>
parents:
9405
diff
changeset
|
1480 call win_gotoid(wid) |
abb72f0b9e06
commit https://github.com/vim/vim/commit/dcb170018642ec144cd87d9d9fe076575b8d1263
Christian Brabandt <cb@256bit.org>
parents:
9405
diff
changeset
|
1481 call assert_equal(2, line('.')) |
9458
374afcf9d11d
commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents:
9432
diff
changeset
|
1482 Xclose |
9432
abb72f0b9e06
commit https://github.com/vim/vim/commit/dcb170018642ec144cd87d9d9fe076575b8d1263
Christian Brabandt <cb@256bit.org>
parents:
9405
diff
changeset
|
1483 endfunc |
9458
374afcf9d11d
commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents:
9432
diff
changeset
|
1484 |
374afcf9d11d
commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents:
9432
diff
changeset
|
1485 " Tests for the :cbottom and :lbottom commands |
374afcf9d11d
commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents:
9432
diff
changeset
|
1486 function Test_cbottom() |
374afcf9d11d
commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents:
9432
diff
changeset
|
1487 call XbottomTests('c') |
374afcf9d11d
commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents:
9432
diff
changeset
|
1488 call XbottomTests('l') |
374afcf9d11d
commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents:
9432
diff
changeset
|
1489 endfunction |
9538
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1490 |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1491 function HistoryTest(cchar) |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1492 call s:setup_commands(a:cchar) |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1493 |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1494 call assert_fails(a:cchar . 'older 99', 'E380:') |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1495 " clear all lists after the first one, then replace the first one. |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1496 call g:Xsetlist([]) |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1497 Xolder |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1498 let entry = {'filename': 'foo', 'lnum': 42} |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1499 call g:Xsetlist([entry], 'r') |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1500 call g:Xsetlist([entry, entry]) |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1501 call g:Xsetlist([entry, entry, entry]) |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1502 let res = split(execute(a:cchar . 'hist'), "\n") |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1503 call assert_equal(3, len(res)) |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1504 let common = 'errors :set' . (a:cchar == 'c' ? 'qf' : 'loc') . 'list()' |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1505 call assert_equal(' error list 1 of 3; 1 ' . common, res[0]) |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1506 call assert_equal(' error list 2 of 3; 2 ' . common, res[1]) |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1507 call assert_equal('> error list 3 of 3; 3 ' . common, res[2]) |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1508 endfunc |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1509 |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1510 func Test_history() |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1511 call HistoryTest('c') |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1512 call HistoryTest('l') |
26da1efa9e46
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents:
9458
diff
changeset
|
1513 endfunc |
9540
64a791c53418
commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents:
9538
diff
changeset
|
1514 |
64a791c53418
commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents:
9538
diff
changeset
|
1515 func Test_duplicate_buf() |
64a791c53418
commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents:
9538
diff
changeset
|
1516 " make sure we can get the highest buffer number |
64a791c53418
commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents:
9538
diff
changeset
|
1517 edit DoesNotExist |
64a791c53418
commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents:
9538
diff
changeset
|
1518 edit DoesNotExist2 |
64a791c53418
commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents:
9538
diff
changeset
|
1519 let last_buffer = bufnr("$") |
64a791c53418
commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents:
9538
diff
changeset
|
1520 |
64a791c53418
commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents:
9538
diff
changeset
|
1521 " make sure only one buffer is created |
64a791c53418
commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents:
9538
diff
changeset
|
1522 call writefile(['this one', 'that one'], 'Xgrepthis') |
64a791c53418
commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents:
9538
diff
changeset
|
1523 vimgrep one Xgrepthis |
64a791c53418
commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents:
9538
diff
changeset
|
1524 vimgrep one Xgrepthis |
64a791c53418
commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents:
9538
diff
changeset
|
1525 call assert_equal(last_buffer + 1, bufnr("$")) |
64a791c53418
commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents:
9538
diff
changeset
|
1526 |
64a791c53418
commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents:
9538
diff
changeset
|
1527 call delete('Xgrepthis') |
64a791c53418
commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents:
9538
diff
changeset
|
1528 endfunc |
9850
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1529 |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1530 " Quickfix/Location list set/get properties tests |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1531 function Xproperty_tests(cchar) |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1532 call s:setup_commands(a:cchar) |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1533 |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1534 " Error cases |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1535 call assert_fails('call g:Xgetlist(99)', 'E715:') |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1536 call assert_fails('call g:Xsetlist(99)', 'E714:') |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1537 call assert_fails('call g:Xsetlist([], "a", [])', 'E715:') |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1538 |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1539 " Set and get the title |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1540 Xopen |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1541 wincmd p |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1542 call g:Xsetlist([{'filename':'foo', 'lnum':27}]) |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1543 call g:Xsetlist([], 'a', {'title' : 'Sample'}) |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1544 let d = g:Xgetlist({"title":1}) |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1545 call assert_equal('Sample', d.title) |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1546 |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1547 Xopen |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1548 call assert_equal('Sample', w:quickfix_title) |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1549 Xclose |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1550 |
9982
e24aa20d815c
commit https://github.com/vim/vim/commit/2b529bb6260b52246e92429375d995b9b5ce76b6
Christian Brabandt <cb@256bit.org>
parents:
9850
diff
changeset
|
1551 " Tests for action argument |
e24aa20d815c
commit https://github.com/vim/vim/commit/2b529bb6260b52246e92429375d995b9b5ce76b6
Christian Brabandt <cb@256bit.org>
parents:
9850
diff
changeset
|
1552 silent! Xolder 999 |
e24aa20d815c
commit https://github.com/vim/vim/commit/2b529bb6260b52246e92429375d995b9b5ce76b6
Christian Brabandt <cb@256bit.org>
parents:
9850
diff
changeset
|
1553 let qfnr = g:Xgetlist({'all':1}).nr |
e24aa20d815c
commit https://github.com/vim/vim/commit/2b529bb6260b52246e92429375d995b9b5ce76b6
Christian Brabandt <cb@256bit.org>
parents:
9850
diff
changeset
|
1554 call g:Xsetlist([], 'r', {'title' : 'N1'}) |
e24aa20d815c
commit https://github.com/vim/vim/commit/2b529bb6260b52246e92429375d995b9b5ce76b6
Christian Brabandt <cb@256bit.org>
parents:
9850
diff
changeset
|
1555 call assert_equal('N1', g:Xgetlist({'all':1}).title) |
e24aa20d815c
commit https://github.com/vim/vim/commit/2b529bb6260b52246e92429375d995b9b5ce76b6
Christian Brabandt <cb@256bit.org>
parents:
9850
diff
changeset
|
1556 call g:Xsetlist([], ' ', {'title' : 'N2'}) |
e24aa20d815c
commit https://github.com/vim/vim/commit/2b529bb6260b52246e92429375d995b9b5ce76b6
Christian Brabandt <cb@256bit.org>
parents:
9850
diff
changeset
|
1557 call assert_equal(qfnr + 1, g:Xgetlist({'all':1}).nr) |
10237
197795e3530d
commit https://github.com/vim/vim/commit/890680ca6364386fabb271c85e0755bcaa6a33c1
Christian Brabandt <cb@256bit.org>
parents:
10056
diff
changeset
|
1558 |
197795e3530d
commit https://github.com/vim/vim/commit/890680ca6364386fabb271c85e0755bcaa6a33c1
Christian Brabandt <cb@256bit.org>
parents:
10056
diff
changeset
|
1559 let res = g:Xgetlist({'nr': 0}) |
197795e3530d
commit https://github.com/vim/vim/commit/890680ca6364386fabb271c85e0755bcaa6a33c1
Christian Brabandt <cb@256bit.org>
parents:
10056
diff
changeset
|
1560 call assert_equal(qfnr + 1, res.nr) |
197795e3530d
commit https://github.com/vim/vim/commit/890680ca6364386fabb271c85e0755bcaa6a33c1
Christian Brabandt <cb@256bit.org>
parents:
10056
diff
changeset
|
1561 call assert_equal(['nr'], keys(res)) |
197795e3530d
commit https://github.com/vim/vim/commit/890680ca6364386fabb271c85e0755bcaa6a33c1
Christian Brabandt <cb@256bit.org>
parents:
10056
diff
changeset
|
1562 |
9982
e24aa20d815c
commit https://github.com/vim/vim/commit/2b529bb6260b52246e92429375d995b9b5ce76b6
Christian Brabandt <cb@256bit.org>
parents:
9850
diff
changeset
|
1563 call g:Xsetlist([], ' ', {'title' : 'N3'}) |
e24aa20d815c
commit https://github.com/vim/vim/commit/2b529bb6260b52246e92429375d995b9b5ce76b6
Christian Brabandt <cb@256bit.org>
parents:
9850
diff
changeset
|
1564 call assert_equal('N2', g:Xgetlist({'nr':2, 'title':1}).title) |
e24aa20d815c
commit https://github.com/vim/vim/commit/2b529bb6260b52246e92429375d995b9b5ce76b6
Christian Brabandt <cb@256bit.org>
parents:
9850
diff
changeset
|
1565 |
9850
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1566 " Invalid arguments |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1567 call assert_fails('call g:Xgetlist([])', 'E715') |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1568 call assert_fails('call g:Xsetlist([], "a", [])', 'E715') |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1569 let s = g:Xsetlist([], 'a', {'abc':1}) |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1570 call assert_equal(-1, s) |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1571 |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1572 call assert_equal({}, g:Xgetlist({'abc':1})) |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1573 |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1574 if a:cchar == 'l' |
10237
197795e3530d
commit https://github.com/vim/vim/commit/890680ca6364386fabb271c85e0755bcaa6a33c1
Christian Brabandt <cb@256bit.org>
parents:
10056
diff
changeset
|
1575 call assert_equal({}, getloclist(99, {'title': 1})) |
9850
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1576 endif |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1577 endfunction |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1578 |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1579 function Test_qf_property() |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1580 call Xproperty_tests('c') |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1581 call Xproperty_tests('l') |
67781bb0a61a
commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents:
9752
diff
changeset
|
1582 endfunction |
10056
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1583 |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1584 " Tests for the QuickFixCmdPre/QuickFixCmdPost autocommands |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1585 function QfAutoCmdHandler(loc, cmd) |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1586 call add(g:acmds, a:loc . a:cmd) |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1587 endfunction |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1588 |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1589 function Test_Autocmd() |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1590 autocmd QuickFixCmdPre * call QfAutoCmdHandler('pre', expand('<amatch>')) |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1591 autocmd QuickFixCmdPost * call QfAutoCmdHandler('post', expand('<amatch>')) |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1592 |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1593 let g:acmds = [] |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1594 cexpr "F1:10:Line 10" |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1595 caddexpr "F1:20:Line 20" |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1596 cgetexpr "F1:30:Line 30" |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1597 enew! | call append(0, "F2:10:Line 10") |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1598 cbuffer! |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1599 enew! | call append(0, "F2:20:Line 20") |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1600 cgetbuffer |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1601 enew! | call append(0, "F2:30:Line 30") |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1602 caddbuffer |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1603 |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1604 let l = ['precexpr', |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1605 \ 'postcexpr', |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1606 \ 'precaddexpr', |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1607 \ 'postcaddexpr', |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1608 \ 'precgetexpr', |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1609 \ 'postcgetexpr', |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1610 \ 'precbuffer', |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1611 \ 'postcbuffer', |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1612 \ 'precgetbuffer', |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1613 \ 'postcgetbuffer', |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1614 \ 'precaddbuffer', |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1615 \ 'postcaddbuffer'] |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1616 call assert_equal(l, g:acmds) |
21f685af3fc1
commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents:
9982
diff
changeset
|
1617 endfunction |