@@ -16,13 +16,13 @@ endfunc
1616
1717func Test_gD ()
1818 let lines = [
19- \ ' int x;' ,
20- \ ' ' ,
21- \ ' int func(void)' ,
22- \ ' {' ,
23- \ ' return x;' ,
24- \ ' }' ,
25- \ ]
19+ \ ' int x;' ,
20+ \ ' ' ,
21+ \ ' int func(void)' ,
22+ \ ' {' ,
23+ \ ' return x;' ,
24+ \ ' }' ,
25+ \ ]
2626 call XTest_goto_decl (' gD' , lines , 1 , 5 )
2727endfunc
2828
@@ -40,236 +40,236 @@ endfunc
4040
4141func Test_gD_comment ()
4242 let lines = [
43- \ ' /* int x; */' ,
44- \ ' int x;' ,
45- \ ' ' ,
46- \ ' int func(void)' ,
47- \ ' {' ,
48- \ ' return x;' ,
49- \ ' }' ,
50- \ ]
43+ \ ' /* int x; */' ,
44+ \ ' int x;' ,
45+ \ ' ' ,
46+ \ ' int func(void)' ,
47+ \ ' {' ,
48+ \ ' return x;' ,
49+ \ ' }' ,
50+ \ ]
5151 call XTest_goto_decl (' gD' , lines , 2 , 5 )
5252endfunc
5353
5454func Test_gD_inline_comment ()
5555 let lines = [
56- \ ' int y /* , x */;' ,
57- \ ' int x;' ,
58- \ ' ' ,
59- \ ' int func(void)' ,
60- \ ' {' ,
61- \ ' return x;' ,
62- \ ' }' ,
63- \ ]
56+ \ ' int y /* , x */;' ,
57+ \ ' int x;' ,
58+ \ ' ' ,
59+ \ ' int func(void)' ,
60+ \ ' {' ,
61+ \ ' return x;' ,
62+ \ ' }' ,
63+ \ ]
6464 call XTest_goto_decl (' gD' , lines , 2 , 5 )
6565endfunc
6666
6767func Test_gD_string ()
6868 let lines = [
69- \ ' char *s[] = "x";' ,
70- \ ' int x = 1;' ,
71- \ ' ' ,
72- \ ' int func(void)' ,
73- \ ' {' ,
74- \ ' return x;' ,
75- \ ' }' ,
76- \ ]
69+ \ ' char *s[] = "x";' ,
70+ \ ' int x = 1;' ,
71+ \ ' ' ,
72+ \ ' int func(void)' ,
73+ \ ' {' ,
74+ \ ' return x;' ,
75+ \ ' }' ,
76+ \ ]
7777 call XTest_goto_decl (' gD' , lines , 2 , 5 )
7878endfunc
7979
8080func Test_gD_string_same_line ()
8181 let lines = [
82- \ ' char *s[] = "x", int x = 1;' ,
83- \ ' ' ,
84- \ ' int func(void)' ,
85- \ ' {' ,
86- \ ' return x;' ,
87- \ ' }' ,
88- \ ]
82+ \ ' char *s[] = "x", int x = 1;' ,
83+ \ ' ' ,
84+ \ ' int func(void)' ,
85+ \ ' {' ,
86+ \ ' return x;' ,
87+ \ ' }' ,
88+ \ ]
8989 call XTest_goto_decl (' gD' , lines , 1 , 22 )
9090endfunc
9191
9292func Test_gD_char ()
9393 let lines = [
94- \ " char c = 'x';" ,
95- \ ' int x = 1;' ,
96- \ ' ' ,
97- \ ' int func(void)' ,
98- \ ' {' ,
99- \ ' return x;' ,
100- \ ' }' ,
101- \ ]
94+ \ " char c = 'x';" ,
95+ \ ' int x = 1;' ,
96+ \ ' ' ,
97+ \ ' int func(void)' ,
98+ \ ' {' ,
99+ \ ' return x;' ,
100+ \ ' }' ,
101+ \ ]
102102 call XTest_goto_decl (' gD' , lines , 2 , 5 )
103103endfunc
104104
105105func Test_gd ()
106106 let lines = [
107- \ ' int x;' ,
108- \ ' ' ,
109- \ ' int func(int x)' ,
110- \ ' {' ,
111- \ ' return x;' ,
112- \ ' }' ,
113- \ ]
107+ \ ' int x;' ,
108+ \ ' ' ,
109+ \ ' int func(int x)' ,
110+ \ ' {' ,
111+ \ ' return x;' ,
112+ \ ' }' ,
113+ \ ]
114114 call XTest_goto_decl (' gd' , lines , 3 , 14 )
115115endfunc
116116
117117func Test_gd_not_local ()
118118 let lines = [
119- \ ' int func1(void)' ,
120- \ ' {' ,
121- \ ' return x;' ,
122- \ ' }' ,
123- \ ' ' ,
124- \ ' int func2(int x)' ,
125- \ ' {' ,
126- \ ' return x;' ,
127- \ ' }' ,
128- \ ]
119+ \ ' int func1(void)' ,
120+ \ ' {' ,
121+ \ ' return x;' ,
122+ \ ' }' ,
123+ \ ' ' ,
124+ \ ' int func2(int x)' ,
125+ \ ' {' ,
126+ \ ' return x;' ,
127+ \ ' }' ,
128+ \ ]
129129 call XTest_goto_decl (' gd' , lines , 3 , 10 )
130130endfunc
131131
132132func Test_gd_kr_style ()
133133 let lines = [
134- \ ' int func(x)' ,
135- \ ' int x;' ,
136- \ ' {' ,
137- \ ' return x;' ,
138- \ ' }' ,
139- \ ]
134+ \ ' int func(x)' ,
135+ \ ' int x;' ,
136+ \ ' {' ,
137+ \ ' return x;' ,
138+ \ ' }' ,
139+ \ ]
140140 call XTest_goto_decl (' gd' , lines , 2 , 7 )
141141endfunc
142142
143143func Test_gd_missing_braces ()
144144 let lines = [
145- \ ' def func1(a)' ,
146- \ ' a + 1' ,
147- \ ' end' ,
148- \ ' ' ,
149- \ ' a = 1' ,
150- \ ' ' ,
151- \ ' def func2()' ,
152- \ ' return a' ,
153- \ ' end' ,
154- \ ]
145+ \ ' def func1(a)' ,
146+ \ ' a + 1' ,
147+ \ ' end' ,
148+ \ ' ' ,
149+ \ ' a = 1' ,
150+ \ ' ' ,
151+ \ ' def func2()' ,
152+ \ ' return a' ,
153+ \ ' end' ,
154+ \ ]
155155 call XTest_goto_decl (' gd' , lines , 1 , 11 )
156156endfunc
157157
158158func Test_gd_comment ()
159159 let lines = [
160- \ ' int func(void)' ,
161- \ ' {' ,
162- \ ' /* int x; */' ,
163- \ ' int x;' ,
164- \ ' return x;' ,
165- \ ' }' ,
166- \]
160+ \ ' int func(void)' ,
161+ \ ' {' ,
162+ \ ' /* int x; */' ,
163+ \ ' int x;' ,
164+ \ ' return x;' ,
165+ \ ' }' ,
166+ \]
167167 call XTest_goto_decl (' gd' , lines , 4 , 7 )
168168endfunc
169169
170170func Test_gd_comment_in_string ()
171171 let lines = [
172- \ ' int func(void)' ,
173- \ ' {' ,
174- \ ' char *s ="//"; int x;' ,
175- \ ' int x;' ,
176- \ ' return x;' ,
177- \ ' }' ,
178- \]
172+ \ ' int func(void)' ,
173+ \ ' {' ,
174+ \ ' char *s ="//"; int x;' ,
175+ \ ' int x;' ,
176+ \ ' return x;' ,
177+ \ ' }' ,
178+ \]
179179 call XTest_goto_decl (' gd' , lines , 3 , 22 )
180180endfunc
181181
182182func Test_gd_string_in_comment ()
183183 set comments =
184184 let lines = [
185- \ ' int func(void)' ,
186- \ ' {' ,
187- \ ' /* " */ int x;' ,
188- \ ' int x;' ,
189- \ ' return x;' ,
190- \ ' }' ,
191- \]
185+ \ ' int func(void)' ,
186+ \ ' {' ,
187+ \ ' /* " */ int x;' ,
188+ \ ' int x;' ,
189+ \ ' return x;' ,
190+ \ ' }' ,
191+ \]
192192 call XTest_goto_decl (' gd' , lines , 3 , 15 )
193193 set comments &
194194endfunc
195195
196196func Test_gd_inline_comment ()
197197 let lines = [
198- \ ' int func(/* x is an int */ int x)' ,
199- \ ' {' ,
200- \ ' return x;' ,
201- \ ' }' ,
202- \ ]
198+ \ ' int func(/* x is an int */ int x)' ,
199+ \ ' {' ,
200+ \ ' return x;' ,
201+ \ ' }' ,
202+ \ ]
203203 call XTest_goto_decl (' gd' , lines , 1 , 32 )
204204endfunc
205205
206206func Test_gd_inline_comment_only ()
207207 let lines = [
208- \ ' int func(void) /* one lonely x */' ,
209- \ ' {' ,
210- \ ' return x;' ,
211- \ ' }' ,
212- \ ]
208+ \ ' int func(void) /* one lonely x */' ,
209+ \ ' {' ,
210+ \ ' return x;' ,
211+ \ ' }' ,
212+ \ ]
213213 call XTest_goto_decl (' gd' , lines , 3 , 10 )
214214endfunc
215215
216216func Test_gd_inline_comment_body ()
217217 let lines = [
218- \ ' int func(void)' ,
219- \ ' {' ,
220- \ ' int y /* , x */;' ,
221- \ ' ' ,
222- \ ' for (/* int x = 0 */; y < 2; y++);' ,
223- \ ' ' ,
224- \ ' int x = 0;' ,
225- \ ' ' ,
226- \ ' return x;' ,
227- \ ' }' ,
228- \ ]
218+ \ ' int func(void)' ,
219+ \ ' {' ,
220+ \ ' int y /* , x */;' ,
221+ \ ' ' ,
222+ \ ' for (/* int x = 0 */; y < 2; y++);' ,
223+ \ ' ' ,
224+ \ ' int x = 0;' ,
225+ \ ' ' ,
226+ \ ' return x;' ,
227+ \ ' }' ,
228+ \ ]
229229 call XTest_goto_decl (' gd' , lines , 7 , 7 )
230230endfunc
231231
232232func Test_gd_trailing_multiline_comment ()
233233 let lines = [
234- \ ' int func(int x) /* x is an int */' ,
235- \ ' {' ,
236- \ ' return x;' ,
237- \ ' }' ,
238- \ ]
234+ \ ' int func(int x) /* x is an int */' ,
235+ \ ' {' ,
236+ \ ' return x;' ,
237+ \ ' }' ,
238+ \ ]
239239 call XTest_goto_decl (' gd' , lines , 1 , 14 )
240240endfunc
241241
242242func Test_gd_trailing_comment ()
243243 let lines = [
244- \ ' int func(int x) // x is an int' ,
245- \ ' {' ,
246- \ ' return x;' ,
247- \ ' }' ,
248- \ ]
244+ \ ' int func(int x) // x is an int' ,
245+ \ ' {' ,
246+ \ ' return x;' ,
247+ \ ' }' ,
248+ \ ]
249249 call XTest_goto_decl (' gd' , lines , 1 , 14 )
250250endfunc
251251
252252func Test_gd_string ()
253253 let lines = [
254- \ ' int func(void)' ,
255- \ ' {' ,
256- \ ' char *s = "x";' ,
257- \ ' int x = 1;' ,
258- \ ' ' ,
259- \ ' return x;' ,
260- \ ' }' ,
261- \ ]
254+ \ ' int func(void)' ,
255+ \ ' {' ,
256+ \ ' char *s = "x";' ,
257+ \ ' int x = 1;' ,
258+ \ ' ' ,
259+ \ ' return x;' ,
260+ \ ' }' ,
261+ \ ]
262262 call XTest_goto_decl (' gd' , lines , 4 , 7 )
263263endfunc
264264
265265func Test_gd_string_only ()
266266 let lines = [
267- \ ' int func(void)' ,
268- \ ' {' ,
269- \ ' char *s = "x";' ,
270- \ ' ' ,
271- \ ' return x;' ,
272- \ ' }' ,
273- \ ]
267+ \ ' int func(void)' ,
268+ \ ' {' ,
269+ \ ' char *s = "x";' ,
270+ \ ' ' ,
271+ \ ' return x;' ,
272+ \ ' }' ,
273+ \ ]
274274 call XTest_goto_decl (' gd' , lines , 5 , 10 )
275275endfunc
0 commit comments