Mercurial > vim
comparison src/testdir/test_goto.vim @ 10255:b2c1b7acf92a v8.0.0025
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Oct 9 15:50:48 2016 +0200
patch 8.0.0025
Problem: Inconsistent use of spaces vs tabs in gd test.
Solution: Use tabs. (Anton Lindqvist)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 09 Oct 2016 16:00:04 +0200 |
parents | bc442c2296a7 |
children | 536a7d49249c |
comparison
equal
deleted
inserted
replaced
10254:adc9fb6a6631 | 10255:b2c1b7acf92a |
---|---|
14 quit! | 14 quit! |
15 endfunc | 15 endfunc |
16 | 16 |
17 func Test_gD() | 17 func Test_gD() |
18 let lines = [ | 18 let lines = [ |
19 \ 'int x;', | 19 \ 'int x;', |
20 \ '', | 20 \ '', |
21 \ 'int func(void)', | 21 \ 'int func(void)', |
22 \ '{', | 22 \ '{', |
23 \ ' return x;', | 23 \ ' return x;', |
24 \ '}', | 24 \ '}', |
25 \ ] | 25 \ ] |
26 call XTest_goto_decl('gD', lines, 1, 5) | 26 call XTest_goto_decl('gD', lines, 1, 5) |
27 endfunc | 27 endfunc |
28 | 28 |
29 func Test_gD_too() | 29 func Test_gD_too() |
30 let lines = [ | 30 let lines = [ |
38 call XTest_goto_decl('gD', lines, 1, 10) | 38 call XTest_goto_decl('gD', lines, 1, 10) |
39 endfunc | 39 endfunc |
40 | 40 |
41 func Test_gD_comment() | 41 func Test_gD_comment() |
42 let lines = [ | 42 let lines = [ |
43 \ '/* int x; */', | 43 \ '/* int x; */', |
44 \ 'int x;', | 44 \ 'int x;', |
45 \ '', | 45 \ '', |
46 \ 'int func(void)', | 46 \ 'int func(void)', |
47 \ '{', | 47 \ '{', |
48 \ ' return x;', | 48 \ ' return x;', |
49 \ '}', | 49 \ '}', |
50 \ ] | 50 \ ] |
51 call XTest_goto_decl('gD', lines, 2, 5) | 51 call XTest_goto_decl('gD', lines, 2, 5) |
52 endfunc | 52 endfunc |
53 | 53 |
54 func Test_gD_inline_comment() | 54 func Test_gD_inline_comment() |
55 let lines = [ | 55 let lines = [ |
56 \ 'int y /* , x */;', | 56 \ 'int y /* , x */;', |
57 \ 'int x;', | 57 \ 'int x;', |
58 \ '', | 58 \ '', |
59 \ 'int func(void)', | 59 \ 'int func(void)', |
60 \ '{', | 60 \ '{', |
61 \ ' return x;', | 61 \ ' return x;', |
62 \ '}', | 62 \ '}', |
63 \ ] | 63 \ ] |
64 call XTest_goto_decl('gD', lines, 2, 5) | 64 call XTest_goto_decl('gD', lines, 2, 5) |
65 endfunc | 65 endfunc |
66 | 66 |
67 func Test_gD_string() | 67 func Test_gD_string() |
68 let lines = [ | 68 let lines = [ |
69 \ 'char *s[] = "x";', | 69 \ 'char *s[] = "x";', |
70 \ 'int x = 1;', | 70 \ 'int x = 1;', |
71 \ '', | 71 \ '', |
72 \ 'int func(void)', | 72 \ 'int func(void)', |
73 \ '{', | 73 \ '{', |
74 \ ' return x;', | 74 \ ' return x;', |
75 \ '}', | 75 \ '}', |
76 \ ] | 76 \ ] |
77 call XTest_goto_decl('gD', lines, 2, 5) | 77 call XTest_goto_decl('gD', lines, 2, 5) |
78 endfunc | 78 endfunc |
79 | 79 |
80 func Test_gD_string_same_line() | 80 func Test_gD_string_same_line() |
81 let lines = [ | 81 let lines = [ |
82 \ 'char *s[] = "x", int x = 1;', | 82 \ 'char *s[] = "x", int x = 1;', |
83 \ '', | 83 \ '', |
84 \ 'int func(void)', | 84 \ 'int func(void)', |
85 \ '{', | 85 \ '{', |
86 \ ' return x;', | 86 \ ' return x;', |
87 \ '}', | 87 \ '}', |
88 \ ] | 88 \ ] |
89 call XTest_goto_decl('gD', lines, 1, 22) | 89 call XTest_goto_decl('gD', lines, 1, 22) |
90 endfunc | 90 endfunc |
91 | 91 |
92 func Test_gD_char() | 92 func Test_gD_char() |
93 let lines = [ | 93 let lines = [ |
94 \ "char c = 'x';", | 94 \ "char c = 'x';", |
95 \ 'int x = 1;', | 95 \ 'int x = 1;', |
96 \ '', | 96 \ '', |
97 \ 'int func(void)', | 97 \ 'int func(void)', |
98 \ '{', | 98 \ '{', |
99 \ ' return x;', | 99 \ ' return x;', |
100 \ '}', | 100 \ '}', |
101 \ ] | 101 \ ] |
102 call XTest_goto_decl('gD', lines, 2, 5) | 102 call XTest_goto_decl('gD', lines, 2, 5) |
103 endfunc | 103 endfunc |
104 | 104 |
105 func Test_gd() | 105 func Test_gd() |
106 let lines = [ | 106 let lines = [ |
107 \ 'int x;', | 107 \ 'int x;', |
108 \ '', | 108 \ '', |
109 \ 'int func(int x)', | 109 \ 'int func(int x)', |
110 \ '{', | 110 \ '{', |
111 \ ' return x;', | 111 \ ' return x;', |
112 \ '}', | 112 \ '}', |
113 \ ] | 113 \ ] |
114 call XTest_goto_decl('gd', lines, 3, 14) | 114 call XTest_goto_decl('gd', lines, 3, 14) |
115 endfunc | 115 endfunc |
116 | 116 |
117 func Test_gd_not_local() | 117 func Test_gd_not_local() |
118 let lines = [ | 118 let lines = [ |
119 \ 'int func1(void)', | 119 \ 'int func1(void)', |
120 \ '{', | 120 \ '{', |
121 \ ' return x;', | 121 \ ' return x;', |
122 \ '}', | 122 \ '}', |
123 \ '', | 123 \ '', |
124 \ 'int func2(int x)', | 124 \ 'int func2(int x)', |
125 \ '{', | 125 \ '{', |
126 \ ' return x;', | 126 \ ' return x;', |
127 \ '}', | 127 \ '}', |
128 \ ] | 128 \ ] |
129 call XTest_goto_decl('gd', lines, 3, 10) | 129 call XTest_goto_decl('gd', lines, 3, 10) |
130 endfunc | 130 endfunc |
131 | 131 |
132 func Test_gd_kr_style() | 132 func Test_gd_kr_style() |
133 let lines = [ | 133 let lines = [ |
134 \ 'int func(x)', | 134 \ 'int func(x)', |
135 \ ' int x;', | 135 \ ' int x;', |
136 \ '{', | 136 \ '{', |
137 \ ' return x;', | 137 \ ' return x;', |
138 \ '}', | 138 \ '}', |
139 \ ] | 139 \ ] |
140 call XTest_goto_decl('gd', lines, 2, 7) | 140 call XTest_goto_decl('gd', lines, 2, 7) |
141 endfunc | 141 endfunc |
142 | 142 |
143 func Test_gd_missing_braces() | 143 func Test_gd_missing_braces() |
144 let lines = [ | 144 let lines = [ |
145 \ 'def func1(a)', | 145 \ 'def func1(a)', |
146 \ ' a + 1', | 146 \ ' a + 1', |
147 \ 'end', | 147 \ 'end', |
148 \ '', | 148 \ '', |
149 \ 'a = 1', | 149 \ 'a = 1', |
150 \ '', | 150 \ '', |
151 \ 'def func2()', | 151 \ 'def func2()', |
152 \ ' return a', | 152 \ ' return a', |
153 \ 'end', | 153 \ 'end', |
154 \ ] | 154 \ ] |
155 call XTest_goto_decl('gd', lines, 1, 11) | 155 call XTest_goto_decl('gd', lines, 1, 11) |
156 endfunc | 156 endfunc |
157 | 157 |
158 func Test_gd_comment() | 158 func Test_gd_comment() |
159 let lines = [ | 159 let lines = [ |
160 \ 'int func(void)', | 160 \ 'int func(void)', |
161 \ '{', | 161 \ '{', |
162 \ ' /* int x; */', | 162 \ ' /* int x; */', |
163 \ ' int x;', | 163 \ ' int x;', |
164 \ ' return x;', | 164 \ ' return x;', |
165 \ '}', | 165 \ '}', |
166 \] | 166 \] |
167 call XTest_goto_decl('gd', lines, 4, 7) | 167 call XTest_goto_decl('gd', lines, 4, 7) |
168 endfunc | 168 endfunc |
169 | 169 |
170 func Test_gd_comment_in_string() | 170 func Test_gd_comment_in_string() |
171 let lines = [ | 171 let lines = [ |
172 \ 'int func(void)', | 172 \ 'int func(void)', |
173 \ '{', | 173 \ '{', |
174 \ ' char *s ="//"; int x;', | 174 \ ' char *s ="//"; int x;', |
175 \ ' int x;', | 175 \ ' int x;', |
176 \ ' return x;', | 176 \ ' return x;', |
177 \ '}', | 177 \ '}', |
178 \] | 178 \] |
179 call XTest_goto_decl('gd', lines, 3, 22) | 179 call XTest_goto_decl('gd', lines, 3, 22) |
180 endfunc | 180 endfunc |
181 | 181 |
182 func Test_gd_string_in_comment() | 182 func Test_gd_string_in_comment() |
183 set comments= | 183 set comments= |
184 let lines = [ | 184 let lines = [ |
185 \ 'int func(void)', | 185 \ 'int func(void)', |
186 \ '{', | 186 \ '{', |
187 \ ' /* " */ int x;', | 187 \ ' /* " */ int x;', |
188 \ ' int x;', | 188 \ ' int x;', |
189 \ ' return x;', | 189 \ ' return x;', |
190 \ '}', | 190 \ '}', |
191 \] | 191 \] |
192 call XTest_goto_decl('gd', lines, 3, 15) | 192 call XTest_goto_decl('gd', lines, 3, 15) |
193 set comments& | 193 set comments& |
194 endfunc | 194 endfunc |
195 | 195 |
196 func Test_gd_inline_comment() | 196 func Test_gd_inline_comment() |
197 let lines = [ | 197 let lines = [ |
198 \ 'int func(/* x is an int */ int x)', | 198 \ 'int func(/* x is an int */ int x)', |
199 \ '{', | 199 \ '{', |
200 \ ' return x;', | 200 \ ' return x;', |
201 \ '}', | 201 \ '}', |
202 \ ] | 202 \ ] |
203 call XTest_goto_decl('gd', lines, 1, 32) | 203 call XTest_goto_decl('gd', lines, 1, 32) |
204 endfunc | 204 endfunc |
205 | 205 |
206 func Test_gd_inline_comment_only() | 206 func Test_gd_inline_comment_only() |
207 let lines = [ | 207 let lines = [ |
208 \ 'int func(void) /* one lonely x */', | 208 \ 'int func(void) /* one lonely x */', |
209 \ '{', | 209 \ '{', |
210 \ ' return x;', | 210 \ ' return x;', |
211 \ '}', | 211 \ '}', |
212 \ ] | 212 \ ] |
213 call XTest_goto_decl('gd', lines, 3, 10) | 213 call XTest_goto_decl('gd', lines, 3, 10) |
214 endfunc | 214 endfunc |
215 | 215 |
216 func Test_gd_inline_comment_body() | 216 func Test_gd_inline_comment_body() |
217 let lines = [ | 217 let lines = [ |
218 \ 'int func(void)', | 218 \ 'int func(void)', |
219 \ '{', | 219 \ '{', |
220 \ ' int y /* , x */;', | 220 \ ' int y /* , x */;', |
221 \ '', | 221 \ '', |
222 \ ' for (/* int x = 0 */; y < 2; y++);', | 222 \ ' for (/* int x = 0 */; y < 2; y++);', |
223 \ '', | 223 \ '', |
224 \ ' int x = 0;', | 224 \ ' int x = 0;', |
225 \ '', | 225 \ '', |
226 \ ' return x;', | 226 \ ' return x;', |
227 \ '}', | 227 \ '}', |
228 \ ] | 228 \ ] |
229 call XTest_goto_decl('gd', lines, 7, 7) | 229 call XTest_goto_decl('gd', lines, 7, 7) |
230 endfunc | 230 endfunc |
231 | 231 |
232 func Test_gd_trailing_multiline_comment() | 232 func Test_gd_trailing_multiline_comment() |
233 let lines = [ | 233 let lines = [ |
234 \ 'int func(int x) /* x is an int */', | 234 \ 'int func(int x) /* x is an int */', |
235 \ '{', | 235 \ '{', |
236 \ ' return x;', | 236 \ ' return x;', |
237 \ '}', | 237 \ '}', |
238 \ ] | 238 \ ] |
239 call XTest_goto_decl('gd', lines, 1, 14) | 239 call XTest_goto_decl('gd', lines, 1, 14) |
240 endfunc | 240 endfunc |
241 | 241 |
242 func Test_gd_trailing_comment() | 242 func Test_gd_trailing_comment() |
243 let lines = [ | 243 let lines = [ |
244 \ 'int func(int x) // x is an int', | 244 \ 'int func(int x) // x is an int', |
245 \ '{', | 245 \ '{', |
246 \ ' return x;', | 246 \ ' return x;', |
247 \ '}', | 247 \ '}', |
248 \ ] | 248 \ ] |
249 call XTest_goto_decl('gd', lines, 1, 14) | 249 call XTest_goto_decl('gd', lines, 1, 14) |
250 endfunc | 250 endfunc |
251 | 251 |
252 func Test_gd_string() | 252 func Test_gd_string() |
253 let lines = [ | 253 let lines = [ |
254 \ 'int func(void)', | 254 \ 'int func(void)', |
255 \ '{', | 255 \ '{', |
256 \ ' char *s = "x";', | 256 \ ' char *s = "x";', |
257 \ ' int x = 1;', | 257 \ ' int x = 1;', |
258 \ '', | 258 \ '', |
259 \ ' return x;', | 259 \ ' return x;', |
260 \ '}', | 260 \ '}', |
261 \ ] | 261 \ ] |
262 call XTest_goto_decl('gd', lines, 4, 7) | 262 call XTest_goto_decl('gd', lines, 4, 7) |
263 endfunc | 263 endfunc |
264 | 264 |
265 func Test_gd_string_only() | 265 func Test_gd_string_only() |
266 let lines = [ | 266 let lines = [ |
267 \ 'int func(void)', | 267 \ 'int func(void)', |
268 \ '{', | 268 \ '{', |
269 \ ' char *s = "x";', | 269 \ ' char *s = "x";', |
270 \ '', | 270 \ '', |
271 \ ' return x;', | 271 \ ' return x;', |
272 \ '}', | 272 \ '}', |
273 \ ] | 273 \ ] |
274 call XTest_goto_decl('gd', lines, 5, 10) | 274 call XTest_goto_decl('gd', lines, 5, 10) |
275 endfunc | 275 endfunc |