Mercurial > vim
annotate src/testdir/test_cdo.vim @ 7382:58958b8c9881 v7.4.996
commit https://github.com/vim/vim/commit/e292d80bede5cb0b9b1ca95176ad6c3fbaae2e0a
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Dec 29 19:03:21 2015 +0100
patch 7.4.996
Problem: New GDK files and testdir/Make_all.mak missing from distribution.
PC build instructions are outdated.
Solution: Add the file to the list. Update PC build instructions.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 29 Dec 2015 19:15:05 +0100 |
parents | 5ac8ee7bf4ff |
children | 779a7c14c795 |
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 lang mess C |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 if !has('quickfix') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 finish |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 endif |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 " Create the files used by the tests |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 function SetUp() |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 call writefile(["Line1", "Line2", "Line3"], 'Xtestfile1') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 call writefile(["Line1", "Line2", "Line3"], 'Xtestfile2') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 call writefile(["Line1", "Line2", "Line3"], 'Xtestfile3') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 endfunction |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 " Remove the files used by the tests |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 function TearDown() |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 call delete('Xtestfile1') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 call delete('Xtestfile2') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 call delete('Xtestfile3') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 endfunction |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 " 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
|
23 function GetRuler() |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 return expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 endfunction |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 " Tests for the :cdo and :ldo commands |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 function XdoTests(cchar) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 " 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
|
32 let Xdo = a:cchar . 'do' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 let Xgetexpr = a:cchar . 'getexpr' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 let Xprev = a:cchar. 'prev' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 let XdoCmd = Xdo . ' call add(l, GetRuler())' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 " Try with an empty list |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 exe XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 call assert_equal([], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 " Populate the list and then try |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 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
|
44 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
45 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 exe XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
47 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
|
48 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
49 " Run command only on selected error lines |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
50 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
51 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
52 exe "2,3" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
53 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
|
54 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
55 " Boundary condition tests |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
56 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
57 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
58 exe "1,1" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
59 call assert_equal(['Xtestfile1 1L 3C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
60 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
61 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
62 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
63 exe "3" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
64 call assert_equal(['Xtestfile3 3L 1C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
65 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
66 " Range test commands |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
67 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
68 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
69 exe "%" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
70 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
|
71 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
72 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
73 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
74 exe "1,$" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
75 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
|
76 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
77 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
78 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
79 exe Xprev |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
80 exe "." . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
81 call assert_equal(['Xtestfile2 2L 2C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
82 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
83 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
84 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
85 exe "+" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
86 call assert_equal(['Xtestfile3 3L 1C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
87 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
88 " Invalid error lines test |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
89 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
90 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
91 exe "silent! 27" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
92 exe "silent! 4,5" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
93 call assert_equal([], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
94 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
95 " Run commands from an unsaved buffer |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
96 let v:errmsg='' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
97 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
98 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
99 setlocal modified |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
100 exe "silent! 2,2" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
101 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
|
102 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
|
103 endif |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
104 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
105 " 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
|
106 enew! |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
107 let subst_count = 0 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
108 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
|
109 if subst_count != 1 || getline('.') != 'xLine1' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
110 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
|
111 endif |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
112 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
113 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
114 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
|
115 call assert_equal(['Xtestfile2 2L 2C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
116 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
117 " List with no valid error entries |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
118 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
119 edit! +2 Xtestfile1 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
120 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
|
121 exe XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
122 call assert_equal([], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
123 exe "silent! 2" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
124 call assert_equal([], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
125 let v:errmsg='' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
126 exe "%" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
127 exe "1,$" . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
128 exe "." . XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
129 call assert_equal('', v:errmsg) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
130 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
131 " List with only one valid entry |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
132 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
133 exe Xgetexpr . " ['Xtestfile3:3:1:Line3']" |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
134 exe XdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
135 call assert_equal(['Xtestfile3 3L 1C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
136 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
137 endfunction |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
138 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
139 " Tests for the :cfdo and :lfdo commands |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
140 function XfdoTests(cchar) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
141 enew |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
142 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
143 " 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
|
144 let Xfdo = a:cchar . 'fdo' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
145 let Xgetexpr = a:cchar . 'getexpr' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
146 let XfdoCmd = Xfdo . ' call add(l, GetRuler())' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
147 let Xpfile = a:cchar. 'pfile' |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
148 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
149 " Clear the quickfix/location list |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
150 exe Xgetexpr . " []" |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
151 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
152 " Try with an empty list |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
153 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
154 exe XfdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
155 call assert_equal([], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
156 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
157 " Populate the list and then try |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
158 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
|
159 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
160 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
161 exe XfdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
162 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
|
163 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
164 " Run command only on selected error lines |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
165 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
166 exe "2,3" . XfdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
167 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
|
168 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
169 " Boundary condition tests |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
170 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
171 exe "3" . XfdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
172 call assert_equal(['Xtestfile3 2L 3C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
173 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
174 " Range test commands |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
175 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
176 exe "%" . XfdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
177 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
|
178 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
179 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
180 exe "1,$" . XfdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
181 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
|
182 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
183 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
184 exe Xpfile |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
185 exe "." . XfdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
186 call assert_equal(['Xtestfile2 2L 2C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
187 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
188 " List with only one valid entry |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
189 let l = [] |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
190 exe Xgetexpr . " ['Xtestfile2:2:5:Line2']" |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
191 exe XfdoCmd |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
192 call assert_equal(['Xtestfile2 2L 5C'], l) |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
193 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
194 endfunction |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
195 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
196 " Tests for cdo and cfdo |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
197 function Test_cdo() |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
198 call XdoTests('c') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
199 call XfdoTests('c') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
200 endfunction |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
201 |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
202 " Tests for ldo and lfdo |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
203 function Test_ldo() |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
204 call XdoTests('l') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
205 call XfdoTests('l') |
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
206 endfunction |