Mercurial > vim
annotate src/testdir/test_cdo.vim @ 11424:328a9ee98fb2 v8.0.0596
patch 8.0.0596: crash when complete() called after complete_add()
commit https://github.com/vim/vim/commit/4475b623960671898dac6a72b13a8d140402afa6
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon May 1 20:46:52 2017 +0200
patch 8.0.0596: crash when complete() called after complete_add()
Problem: Crash when complete() is called after complete_add() in
'completefunc'. (Lifepillar)
Solution: Bail out if compl_pattern is NULL. (closes #1668)
Also avoid using freed memory.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 01 May 2017 21:00:04 +0200 |
parents | 779a7c14c795 |
children | ba7727889385 |
rev | line source |
---|---|
7350
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for the :cdo, :cfdo, :ldo and :lfdo commands |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 if !has('quickfix') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 finish |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 endif |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 " Create the files used by the tests |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 function SetUp() |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 call writefile(["Line1", "Line2", "Line3"], 'Xtestfile1') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 call writefile(["Line1", "Line2", "Line3"], 'Xtestfile2') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 call writefile(["Line1", "Line2", "Line3"], 'Xtestfile3') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 endfunction |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 " Remove the files used by the tests |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 function TearDown() |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 call delete('Xtestfile1') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 call delete('Xtestfile2') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 call delete('Xtestfile3') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 endfunction |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 " Returns the current line in '<filename> <linenum>L <column>C' format |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 function GetRuler() |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 return expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 endfunction |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 " Tests for the :cdo and :ldo commands |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 function XdoTests(cchar) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 " Shortcuts for calling the cdo and ldo commands |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 let Xdo = a:cchar . 'do' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 let Xgetexpr = a:cchar . 'getexpr' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 let Xprev = a:cchar. 'prev' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 let XdoCmd = Xdo . ' call add(l, GetRuler())' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 " Try with an empty list |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 exe XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 call assert_equal([], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 " Populate the list and then try |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 exe Xgetexpr . " ['non-error 1', 'Xtestfile1:1:3:Line1', 'non-error 2', 'Xtestfile2:2:2:Line2', 'non-error 3', 'Xtestfile3:3:1:Line3']" |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
44 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
45 exe XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 call assert_equal(['Xtestfile1 1L 3C', 'Xtestfile2 2L 2C', 'Xtestfile3 3L 1C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
47 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
48 " Run command only on selected error lines |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
49 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
50 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
51 exe "2,3" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
52 call assert_equal(['Xtestfile2 2L 2C', 'Xtestfile3 3L 1C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
53 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
54 " Boundary condition tests |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
55 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
56 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
57 exe "1,1" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
58 call assert_equal(['Xtestfile1 1L 3C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
59 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
60 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
61 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
62 exe "3" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
63 call assert_equal(['Xtestfile3 3L 1C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
64 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
65 " Range test commands |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
66 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
67 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
68 exe "%" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
69 call assert_equal(['Xtestfile1 1L 3C', 'Xtestfile2 2L 2C', 'Xtestfile3 3L 1C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
70 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
71 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
72 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
73 exe "1,$" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
74 call assert_equal(['Xtestfile1 1L 3C', 'Xtestfile2 2L 2C', 'Xtestfile3 3L 1C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
75 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
76 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
77 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
78 exe Xprev |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
79 exe "." . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
80 call assert_equal(['Xtestfile2 2L 2C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
81 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
82 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
83 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
84 exe "+" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
85 call assert_equal(['Xtestfile3 3L 1C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
86 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
87 " Invalid error lines test |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
88 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
89 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
90 exe "silent! 27" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
91 exe "silent! 4,5" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
92 call assert_equal([], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
93 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
94 " Run commands from an unsaved buffer |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
95 let v:errmsg='' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
96 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
97 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
98 setlocal modified |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
99 exe "silent! 2,2" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
100 if v:errmsg !~# 'No write since last change' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
101 call add(v:errors, 'Unsaved file change test failed') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
102 endif |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
103 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
104 " If the executed command fails, then the operation should be aborted |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
105 enew! |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
106 let subst_count = 0 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
107 exe "silent!" . Xdo . " s/Line/xLine/ | let subst_count += 1" |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
108 if subst_count != 1 || getline('.') != 'xLine1' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
109 call add(v:errors, 'Abort command on error test failed') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
110 endif |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
111 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
112 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
113 exe "2,2" . Xdo . "! call add(l, GetRuler())" |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
114 call assert_equal(['Xtestfile2 2L 2C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
115 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
116 " List with no valid error entries |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
117 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
118 edit! +2 Xtestfile1 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
119 exe Xgetexpr . " ['non-error 1', 'non-error 2', 'non-error 3']" |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
120 exe XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
121 call assert_equal([], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
122 exe "silent! 2" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
123 call assert_equal([], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
124 let v:errmsg='' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
125 exe "%" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
126 exe "1,$" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
127 exe "." . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
128 call assert_equal('', v:errmsg) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
129 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
130 " List with only one valid entry |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
131 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
132 exe Xgetexpr . " ['Xtestfile3:3:1:Line3']" |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
133 exe XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
134 call assert_equal(['Xtestfile3 3L 1C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
135 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
136 endfunction |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
137 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
138 " Tests for the :cfdo and :lfdo commands |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
139 function XfdoTests(cchar) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
140 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
141 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
142 " Shortcuts for calling the cfdo and lfdo commands |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
143 let Xfdo = a:cchar . 'fdo' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
144 let Xgetexpr = a:cchar . 'getexpr' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
145 let XfdoCmd = Xfdo . ' call add(l, GetRuler())' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
146 let Xpfile = a:cchar. 'pfile' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
147 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
148 " Clear the quickfix/location list |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
149 exe Xgetexpr . " []" |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
150 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
151 " Try with an empty list |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
152 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
153 exe XfdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
154 call assert_equal([], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
155 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
156 " Populate the list and then try |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
157 exe Xgetexpr . " ['non-error 1', 'Xtestfile1:1:3:Line1', 'Xtestfile1:2:1:Line2', 'non-error 2', 'Xtestfile2:2:2:Line2', 'non-error 3', 'Xtestfile3:2:3:Line2', 'Xtestfile3:3:1:Line3']" |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
158 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
159 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
160 exe XfdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
161 call assert_equal(['Xtestfile1 1L 3C', 'Xtestfile2 2L 2C', 'Xtestfile3 2L 3C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
162 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
163 " Run command only on selected error lines |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
164 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
165 exe "2,3" . XfdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
166 call assert_equal(['Xtestfile2 2L 2C', 'Xtestfile3 2L 3C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
167 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
168 " Boundary condition tests |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
169 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
170 exe "3" . XfdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
171 call assert_equal(['Xtestfile3 2L 3C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
172 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
173 " Range test commands |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
174 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
175 exe "%" . XfdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
176 call assert_equal(['Xtestfile1 1L 3C', 'Xtestfile2 2L 2C', 'Xtestfile3 2L 3C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
177 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
178 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
179 exe "1,$" . XfdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
180 call assert_equal(['Xtestfile1 1L 3C', 'Xtestfile2 2L 2C', 'Xtestfile3 2L 3C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
181 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
182 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
183 exe Xpfile |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
184 exe "." . XfdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
185 call assert_equal(['Xtestfile2 2L 2C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
186 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
187 " List with only one valid entry |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
188 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
189 exe Xgetexpr . " ['Xtestfile2:2:5:Line2']" |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
190 exe XfdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
191 call assert_equal(['Xtestfile2 2L 5C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
192 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
193 endfunction |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
194 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
195 " Tests for cdo and cfdo |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
196 function Test_cdo() |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
197 call XdoTests('c') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
198 call XfdoTests('c') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
199 endfunction |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
200 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
201 " Tests for ldo and lfdo |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
202 function Test_ldo() |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
203 call XdoTests('l') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
204 call XfdoTests('l') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
205 endfunction |