Mercurial > vim
annotate src/testdir/test29.in @ 14989:85467d180844 v8.1.0506
patch 8.1.0506: modeline test fails when run by root
commit https://github.com/vim/vim/commit/9691f82f862ed18c2e3e48f9d2cd902bb947f803
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Nov 3 19:06:25 2018 +0100
patch 8.1.0506: modeline test fails when run by root
Problem: Modeline test fails when run by root.
Solution: Set 'modeline' for the test. (James McCoy, closes https://github.com/vim/vim/issues/3592)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 03 Nov 2018 19:15:08 +0100 |
parents | ae45d497868f |
children |
rev | line source |
---|---|
2291
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
1 Test for joining lines and marks in them |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
2 in compatible and nocompatible modes |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
3 and with 'joinspaces' set or not |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
4 and with 'cpoptions' flag 'j' set or not |
7 | 5 |
6 STARTTEST | |
3562 | 7 :so small.vim |
2456
2876ac15b8c8
Avoid that running tests changes viminfo.
Bram Moolenaar <bram@vim.org>
parents:
2291
diff
changeset
|
8 :set nocompatible viminfo+=nviminfo |
7 | 9 :set nojoinspaces |
2291
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
10 :set cpoptions-=j |
7 | 11 /firstline/ |
3562 | 12 j"td/^STARTTEST/-1 |
13 PJjJjJjJjJjJjJjJjJjJjJjJjJjJj05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions+=j | |
2291
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
14 j05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions-=j joinspaces |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
15 j"tpJjJjJjJjJjJjJjJjJjJjJjJjJjJj05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions+=j |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
16 j05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions-=j nojoinspaces compatible |
3562 | 17 j"tpJjJjJjJjJjJjJjJjJjJjJjJjJjJj4Jy3l$pjd/STARTTEST/-2 |
7 | 18 ENDTEST |
19 | |
20 firstline | |
21 asdfasdf. | |
22 asdf | |
23 asdfasdf. | |
24 asdf | |
25 asdfasdf. | |
26 asdf | |
27 asdfasdf. | |
28 asdf | |
29 asdfasdf. | |
30 asdf | |
31 asdfasdf. | |
32 asdf | |
33 asdfasdf. | |
34 asdf | |
35 asdfasdf | |
36 asdf | |
37 asdfasdf | |
38 asdf | |
39 asdfasdf | |
40 asdf | |
41 asdfasdf | |
42 asdf | |
43 asdfasdf | |
44 asdf | |
45 asdfasdf | |
46 asdf | |
47 asdfasdf | |
48 asdf | |
2291
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
49 zx cvn. |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
50 as dfg? |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
51 hjkl iop! |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
52 ert |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
53 zx cvn. |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
54 as dfg? |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
55 hjkl iop! |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
56 ert |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
57 |
3562 | 58 STARTTEST |
59 /^{/+1 | |
60 :set comments=s1:/*,mb:*,ex:*/,:// | |
61 :set nojoinspaces fo=j | |
62 :set backspace=eol,start | |
63 :.,+3join | |
64 j4J | |
65 :.,+2join | |
66 j3J | |
67 :.,+2join | |
68 j3J | |
69 :.,+2join | |
70 jj3J | |
71 ENDTEST | |
72 | |
73 { | |
74 | |
75 /* | |
76 * Make sure the previous comment leader is not removed. | |
77 */ | |
78 | |
79 /* | |
80 * Make sure the previous comment leader is not removed. | |
81 */ | |
82 | |
83 // Should the next comment leader be left alone? | |
84 // Yes. | |
85 | |
86 // Should the next comment leader be left alone? | |
87 // Yes. | |
88 | |
89 /* Here the comment leader should be left intact. */ | |
90 // And so should this one. | |
91 | |
92 /* Here the comment leader should be left intact. */ | |
93 // And so should this one. | |
94 | |
95 if (condition) // Remove the next comment leader! | |
96 // OK, I will. | |
97 action(); | |
98 | |
99 if (condition) // Remove the next comment leader! | |
100 // OK, I will. | |
101 action(); | |
102 } | |
103 | |
104 STARTTEST | |
5852 | 105 :" Test with backspace set to the non-compatible setting |
11091
ae45d497868f
patch 8.0.0433: beeps when running tests
Christian Brabandt <cb@256bit.org>
parents:
7003
diff
changeset
|
106 :set belloff=all |
5852 | 107 /^\d\+ this |
108 :set cp bs=2 | |
109 Avim1 | |
110 Avim2u | |
111 :set cpo-=< | |
112 :inoremap <c-u> <left><c-u> | |
113 Avim3 | |
114 :iunmap <c-u> | |
115 Avim4 | |
116 :" Test with backspace set to the compatible setting | |
7003 | 117 :set backspace= visualbell |
5852 | 118 A vim5A |
119 A vim6Azweiu | |
120 :inoremap <c-u> <left><c-u> | |
121 A vim7 | |
7003 | 122 :set compatible novisualbell |
5852 | 123 ENDTEST |
124 1 this shouldn't be deleted | |
125 2 this shouldn't be deleted | |
126 3 this shouldn't be deleted | |
127 4 this should be deleted | |
128 5 this shouldn't be deleted | |
129 6 this shouldn't be deleted | |
130 7 this shouldn't be deleted | |
131 8 this shouldn't be deleted (not touched yet) | |
132 | |
133 STARTTEST | |
3562 | 134 /^{/+1 |
3580 | 135 :set comments=sO:*\ -,mO:*\ \ ,exO:*/ |
136 :set comments+=s1:/*,mb:*,ex:*/,:// | |
3562 | 137 :set comments+=s1:>#,mb:#,ex:#<,:< |
138 :set cpoptions-=j joinspaces fo=j | |
139 :set backspace=eol,start | |
140 :.,+3join | |
141 j4J | |
3580 | 142 :.,+8join |
143 j9J | |
3562 | 144 :.,+2join |
145 j3J | |
146 :.,+2join | |
147 j3J | |
148 :.,+2join | |
149 jj3J | |
150 j:.,+2join | |
151 jj3J | |
152 j:.,+5join | |
153 j6J | |
154 oSome code! // Make sure backspacing does not remove this comment leader.0i | |
155 ENDTEST | |
156 | |
157 { | |
158 | |
159 /* | |
160 * Make sure the previous comment leader is not removed. | |
161 */ | |
162 | |
163 /* | |
164 * Make sure the previous comment leader is not removed. | |
165 */ | |
166 | |
3580 | 167 /* List: |
168 * - item1 | |
169 * foo bar baz | |
170 * foo bar baz | |
171 * - item2 | |
172 * foo bar baz | |
173 * foo bar baz | |
174 */ | |
175 | |
176 /* List: | |
177 * - item1 | |
178 * foo bar baz | |
179 * foo bar baz | |
180 * - item2 | |
181 * foo bar baz | |
182 * foo bar baz | |
183 */ | |
184 | |
3562 | 185 // Should the next comment leader be left alone? |
186 // Yes. | |
187 | |
188 // Should the next comment leader be left alone? | |
189 // Yes. | |
190 | |
191 /* Here the comment leader should be left intact. */ | |
192 // And so should this one. | |
193 | |
194 /* Here the comment leader should be left intact. */ | |
195 // And so should this one. | |
196 | |
197 if (condition) // Remove the next comment leader! | |
198 // OK, I will. | |
199 action(); | |
200 | |
201 if (condition) // Remove the next comment leader! | |
202 // OK, I will. | |
203 action(); | |
204 | |
205 int i = 7 /* foo *// 3 | |
206 // comment | |
207 ; | |
208 | |
209 int i = 7 /* foo *// 3 | |
210 // comment | |
211 ; | |
212 | |
213 ># Note that the last character of the ending comment leader (left angle | |
214 # bracket) is a comment leader itself. Make sure that this comment leader is | |
215 # not removed from the next line #< | |
216 < On this line a new comment is opened which spans 2 lines. This comment should | |
217 < retain its comment leader. | |
218 | |
219 ># Note that the last character of the ending comment leader (left angle | |
220 # bracket) is a comment leader itself. Make sure that this comment leader is | |
221 # not removed from the next line #< | |
222 < On this line a new comment is opened which spans 2 lines. This comment should | |
223 < retain its comment leader. | |
224 | |
225 } | |
226 | |
227 STARTTEST | |
228 :g/^STARTTEST/.,/^ENDTEST/d | |
229 :?firstline?+1,$w! test.out | |
230 :qa! | |
231 ENDTEST |