119
|
1 Tests for List and Dictionary types. vim: set ft=vim :
|
|
2
|
|
3 STARTTEST
|
|
4 :so small.vim
|
148
|
5 :fun Test(...)
|
4191
|
6 :lang C
|
119
|
7 :" Creating List directly with different types
|
|
8 :let l = [1, 'as''d', [1, 2, function("strlen")], {'a': 1},]
|
|
9 :$put =string(l)
|
|
10 :$put =string(l[-1])
|
|
11 :$put =string(l[-4])
|
|
12 :try
|
|
13 : $put =string(l[-5])
|
|
14 :catch
|
|
15 : $put =v:exception[:14]
|
|
16 :endtry
|
842
|
17 :" List slices
|
|
18 :$put =string(l[:])
|
|
19 :$put =string(l[1:])
|
|
20 :$put =string(l[:-2])
|
|
21 :$put =string(l[0:8])
|
|
22 :$put =string(l[8:-1])
|
119
|
23 :"
|
|
24 :" List identity
|
|
25 :let ll = l
|
|
26 :let lx = copy(l)
|
|
27 :try
|
|
28 : $put =(l == ll) . (l isnot ll) . (l is ll) . (l == lx) . (l is lx) . (l isnot lx)
|
|
29 :catch
|
|
30 : $put =v:exception
|
|
31 :endtry
|
|
32 :"
|
|
33 :" Creating Dictionary directly with different types
|
|
34 :let d = {001: 'asd', 'b': [1, 2, function('strlen')], -1: {'a': 1},}
|
|
35 :$put =string(d) . d.1
|
|
36 :$put =string(sort(keys(d)))
|
148
|
37 :$put =string (values(d))
|
119
|
38 :for [key, val] in items(d)
|
|
39 : $put =key . ':' . string(val)
|
|
40 : unlet key val
|
|
41 :endfor
|
148
|
42 :call extend (d, {3:33, 1:99})
|
119
|
43 :call extend(d, {'b':'bbb', 'c':'ccc'}, "keep")
|
|
44 :try
|
|
45 : call extend(d, {3:333,4:444}, "error")
|
|
46 :catch
|
|
47 : $put =v:exception[:15] . v:exception[-1:-1]
|
|
48 :endtry
|
|
49 :$put =string(d)
|
|
50 :call filter(d, 'v:key =~ ''[ac391]''')
|
|
51 :$put =string(d)
|
|
52 :"
|
|
53 :" Dictionary identity
|
|
54 :let dd = d
|
|
55 :let dx = copy(d)
|
|
56 :try
|
|
57 : $put =(d == dd) . (d isnot dd) . (d is dd) . (d == dx) . (d is dx) . (d isnot dx)
|
|
58 :catch
|
|
59 : $put =v:exception
|
|
60 :endtry
|
|
61 :"
|
|
62 :" Changing var type should fail
|
|
63 :try
|
|
64 : let d = []
|
|
65 :catch
|
|
66 : $put =v:exception[:14] . v:exception[-1:-1]
|
|
67 :endtry
|
|
68 :try
|
|
69 : let l = {}
|
|
70 :catch
|
|
71 : $put =v:exception[:14] . v:exception[-1:-1]
|
|
72 :endtry
|
|
73 :"
|
|
74 :" removing items with :unlet
|
|
75 :unlet l[2]
|
|
76 :$put =string(l)
|
|
77 :let l = range(8)
|
148
|
78 :try
|
119
|
79 :unlet l[:3]
|
|
80 :unlet l[1:]
|
148
|
81 :catch
|
|
82 :$put =v:exception
|
|
83 :endtry
|
119
|
84 :$put =string(l)
|
|
85 :"
|
|
86 :unlet d.c
|
|
87 :unlet d[-1]
|
|
88 :$put =string(d)
|
|
89 :"
|
842
|
90 :" removing items out of range: silently skip items that don't exist
|
|
91 let l = [0, 1, 2, 3]
|
|
92 :unlet l[2:1]
|
|
93 :$put =string(l)
|
|
94 let l = [0, 1, 2, 3]
|
|
95 :unlet l[2:2]
|
|
96 :$put =string(l)
|
|
97 let l = [0, 1, 2, 3]
|
|
98 :unlet l[2:3]
|
|
99 :$put =string(l)
|
|
100 let l = [0, 1, 2, 3]
|
|
101 :unlet l[2:4]
|
|
102 :$put =string(l)
|
|
103 let l = [0, 1, 2, 3]
|
|
104 :unlet l[2:5]
|
|
105 :$put =string(l)
|
|
106 let l = [0, 1, 2, 3]
|
|
107 :unlet l[-1:2]
|
|
108 :$put =string(l)
|
|
109 let l = [0, 1, 2, 3]
|
|
110 :unlet l[-2:2]
|
|
111 :$put =string(l)
|
|
112 let l = [0, 1, 2, 3]
|
|
113 :unlet l[-3:2]
|
|
114 :$put =string(l)
|
|
115 let l = [0, 1, 2, 3]
|
|
116 :unlet l[-4:2]
|
|
117 :$put =string(l)
|
|
118 let l = [0, 1, 2, 3]
|
|
119 :unlet l[-5:2]
|
|
120 :$put =string(l)
|
|
121 let l = [0, 1, 2, 3]
|
|
122 :unlet l[-6:2]
|
|
123 :$put =string(l)
|
|
124 :"
|
|
125 :" assignment to a list
|
|
126 :let l = [0, 1, 2, 3]
|
|
127 :let [va, vb] = l[2:3]
|
|
128 :$put =va
|
|
129 :$put =vb
|
|
130 :try
|
|
131 : let [va, vb] = l
|
|
132 :catch
|
|
133 : $put =v:exception[:14]
|
|
134 :endtry
|
|
135 :try
|
|
136 : let [va, vb] = l[1:1]
|
|
137 :catch
|
|
138 : $put =v:exception[:14]
|
|
139 :endtry
|
|
140 :"
|
123
|
141 :" manipulating a big Dictionary (hashtable.c has a border of 1000 entries)
|
119
|
142 :let d = {}
|
123
|
143 :for i in range(1500)
|
|
144 : let d[i] = 3000 - i
|
119
|
145 :endfor
|
123
|
146 :$put =d[0] . ' ' . d[100] . ' ' . d[999] . ' ' . d[1400] . ' ' . d[1499]
|
119
|
147 :try
|
123
|
148 : let n = d[1500]
|
119
|
149 :catch
|
1539
|
150 : $put =substitute(v:exception, '\v(.{14}).*( \d{4}).*', '\1\2', '')
|
119
|
151 :endtry
|
|
152 :" lookup each items
|
123
|
153 :for i in range(1500)
|
|
154 : if d[i] != 3000 - i
|
119
|
155 : $put =d[i]
|
|
156 : endif
|
|
157 :endfor
|
|
158 : let i += 1
|
|
159 :" delete even items
|
|
160 :while i >= 2
|
|
161 : let i -= 2
|
|
162 : unlet d[i]
|
|
163 :endwhile
|
123
|
164 :$put =get(d, 1500 - 100, 'NONE') . ' ' . d[1]
|
119
|
165 :" delete odd items, checking value, one intentionally wrong
|
|
166 :let d[33] = 999
|
|
167 :let i = 1
|
123
|
168 :while i < 1500
|
|
169 : if d[i] != 3000 - i
|
119
|
170 : $put =i . '=' . d[i]
|
|
171 : else
|
|
172 : unlet d[i]
|
|
173 : endif
|
|
174 : let i += 2
|
|
175 :endwhile
|
|
176 :$put =string(d) " must be almost empty now
|
|
177 :unlet d
|
|
178 :"
|
|
179 :" Dictionary function
|
|
180 :let dict = {}
|
|
181 :func dict.func(a) dict
|
|
182 : $put =a:a . len(self.data)
|
|
183 :endfunc
|
|
184 :let dict.data = [1,2,3]
|
|
185 :call dict.func("len: ")
|
123
|
186 :let x = dict.func("again: ")
|
119
|
187 :try
|
|
188 : let Fn = dict.func
|
|
189 : call Fn('xxx')
|
|
190 :catch
|
|
191 : $put =v:exception[:15]
|
|
192 :endtry
|
123
|
193 :"
|
|
194 :" Function in script-local List or Dict
|
|
195 :let g:dict = {}
|
|
196 :function g:dict.func() dict
|
|
197 : $put ='g:dict.func'.self.foo[1].self.foo[0]('asdf')
|
|
198 :endfunc
|
|
199 :let g:dict.foo = ['-', 2, 3]
|
|
200 :call insert(g:dict.foo, function('strlen'))
|
|
201 :call g:dict.func()
|
119
|
202 :"
|
|
203 :" Nasty: remove func from Dict that's being called (works)
|
|
204 :let d = {1:1}
|
|
205 :func d.func(a)
|
|
206 : return "a:". a:a
|
|
207 :endfunc
|
148
|
208 :$put =d.func(string(remove(d, 'func')))
|
119
|
209 :"
|
164
|
210 :" Nasty: deepcopy() dict that refers to itself (fails when noref used)
|
119
|
211 :let d = {1:1, 2:2}
|
|
212 :let l = [4, d, 6]
|
|
213 :let d[3] = l
|
164
|
214 :let dc = deepcopy(d)
|
119
|
215 :try
|
164
|
216 : let dc = deepcopy(d, 1)
|
119
|
217 :catch
|
|
218 : $put =v:exception[:14]
|
|
219 :endtry
|
164
|
220 :let l2 = [0, l, l, 3]
|
|
221 :let l[1] = l2
|
|
222 :let l3 = deepcopy(l2)
|
|
223 :$put ='same list: ' . (l3[1] is l3[2])
|
119
|
224 :"
|
148
|
225 :" Locked variables
|
|
226 :for depth in range(5)
|
|
227 : $put ='depth is ' . depth
|
|
228 : for u in range(3)
|
|
229 : unlet l
|
|
230 : let l = [0, [1, [2, 3]], {4: 5, 6: {7: 8}}]
|
|
231 : exe "lockvar " . depth . " l"
|
|
232 : if u == 1
|
|
233 : exe "unlockvar l"
|
|
234 : elseif u == 2
|
|
235 : exe "unlockvar " . depth . " l"
|
|
236 : endif
|
|
237 : let ps = islocked("l").islocked("l[1]").islocked("l[1][1]").islocked("l[1][1][0]").'-'.islocked("l[2]").islocked("l[2]['6']").islocked("l[2]['6'][7]")
|
|
238 : $put =ps
|
|
239 : let ps = ''
|
|
240 : try
|
|
241 : let l[1][1][0] = 99
|
|
242 : let ps .= 'p'
|
|
243 : catch
|
|
244 : let ps .= 'F'
|
|
245 : endtry
|
|
246 : try
|
|
247 : let l[1][1] = [99]
|
|
248 : let ps .= 'p'
|
|
249 : catch
|
|
250 : let ps .= 'F'
|
|
251 : endtry
|
|
252 : try
|
|
253 : let l[1] = [99]
|
|
254 : let ps .= 'p'
|
|
255 : catch
|
|
256 : let ps .= 'F'
|
|
257 : endtry
|
|
258 : try
|
|
259 : let l[2]['6'][7] = 99
|
|
260 : let ps .= 'p'
|
|
261 : catch
|
|
262 : let ps .= 'F'
|
|
263 : endtry
|
|
264 : try
|
|
265 : let l[2][6] = {99: 99}
|
|
266 : let ps .= 'p'
|
|
267 : catch
|
|
268 : let ps .= 'F'
|
|
269 : endtry
|
|
270 : try
|
|
271 : let l[2] = {99: 99}
|
|
272 : let ps .= 'p'
|
|
273 : catch
|
|
274 : let ps .= 'F'
|
|
275 : endtry
|
|
276 : try
|
|
277 : let l = [99]
|
|
278 : let ps .= 'p'
|
|
279 : catch
|
|
280 : let ps .= 'F'
|
|
281 : endtry
|
|
282 : $put =ps
|
|
283 : endfor
|
|
284 :endfor
|
6751
|
285 :"
|
|
286 :" Unletting locked variables
|
|
287 :$put ='Unletting:'
|
|
288 :for depth in range(5)
|
|
289 : $put ='depth is ' . depth
|
|
290 : for u in range(3)
|
|
291 : unlet l
|
|
292 : let l = [0, [1, [2, 3]], {4: 5, 6: {7: 8}}]
|
|
293 : exe "lockvar " . depth . " l"
|
|
294 : if u == 1
|
|
295 : exe "unlockvar l"
|
|
296 : elseif u == 2
|
|
297 : exe "unlockvar " . depth . " l"
|
|
298 : endif
|
|
299 : let ps = islocked("l").islocked("l[1]").islocked("l[1][1]").islocked("l[1][1][0]").'-'.islocked("l[2]").islocked("l[2]['6']").islocked("l[2]['6'][7]")
|
|
300 : $put =ps
|
|
301 : let ps = ''
|
|
302 : try
|
|
303 : unlet l[2]['6'][7]
|
|
304 : let ps .= 'p'
|
|
305 : catch
|
|
306 : let ps .= 'F'
|
|
307 : endtry
|
|
308 : try
|
|
309 : unlet l[2][6]
|
|
310 : let ps .= 'p'
|
|
311 : catch
|
|
312 : let ps .= 'F'
|
|
313 : endtry
|
|
314 : try
|
|
315 : unlet l[2]
|
|
316 : let ps .= 'p'
|
|
317 : catch
|
|
318 : let ps .= 'F'
|
|
319 : endtry
|
|
320 : try
|
|
321 : unlet l[1][1][0]
|
|
322 : let ps .= 'p'
|
|
323 : catch
|
|
324 : let ps .= 'F'
|
|
325 : endtry
|
|
326 : try
|
|
327 : unlet l[1][1]
|
|
328 : let ps .= 'p'
|
|
329 : catch
|
|
330 : let ps .= 'F'
|
|
331 : endtry
|
|
332 : try
|
|
333 : unlet l[1]
|
|
334 : let ps .= 'p'
|
|
335 : catch
|
|
336 : let ps .= 'F'
|
|
337 : endtry
|
|
338 : try
|
|
339 : unlet l
|
|
340 : let ps .= 'p'
|
|
341 : catch
|
|
342 : let ps .= 'F'
|
|
343 : endtry
|
|
344 : $put =ps
|
|
345 : endfor
|
|
346 :endfor
|
|
347 :"
|
|
348 :" Locked variables and :unlet or list / dict functions
|
|
349 :$put ='Locks and commands or functions:'
|
|
350 :"
|
|
351 :$put ='No :unlet after lock on dict:'
|
|
352 :unlet! d
|
|
353 :let d = {'a': 99, 'b': 100}
|
|
354 :lockvar 1 d
|
|
355 :try
|
|
356 : unlet d.a
|
|
357 : $put ='did :unlet'
|
|
358 :catch
|
|
359 : $put =v:exception[:16]
|
|
360 :endtry
|
|
361 :$put =string(d)
|
|
362 :"
|
|
363 :$put =':unlet after lock on dict item:'
|
|
364 :unlet! d
|
|
365 :let d = {'a': 99, 'b': 100}
|
|
366 :lockvar d.a
|
|
367 :try
|
|
368 : unlet d.a
|
|
369 : $put ='did :unlet'
|
|
370 :catch
|
|
371 : $put =v:exception[:16]
|
|
372 :endtry
|
|
373 :$put =string(d)
|
|
374 :"
|
|
375 :$put ='filter() after lock on dict item:'
|
|
376 :unlet! d
|
|
377 :let d = {'a': 99, 'b': 100}
|
|
378 :lockvar d.a
|
|
379 :try
|
|
380 : call filter(d, 'v:key != "a"')
|
|
381 : $put ='did filter()'
|
|
382 :catch
|
|
383 : $put =v:exception[:16]
|
|
384 :endtry
|
|
385 :$put =string(d)
|
|
386 :"
|
|
387 :$put ='map() after lock on dict:'
|
|
388 :unlet! d
|
|
389 :let d = {'a': 99, 'b': 100}
|
|
390 :lockvar 1 d
|
|
391 :try
|
|
392 : call map(d, 'v:val + 200')
|
|
393 : $put ='did map()'
|
|
394 :catch
|
|
395 : $put =v:exception[:16]
|
|
396 :endtry
|
|
397 :$put =string(d)
|
|
398 :"
|
|
399 :$put ='No extend() after lock on dict item:'
|
|
400 :unlet! d
|
|
401 :let d = {'a': 99, 'b': 100}
|
|
402 :lockvar d.a
|
|
403 :try
|
|
404 : $put =string(extend(d, {'a': 123}))
|
|
405 : $put ='did extend()'
|
|
406 :catch
|
|
407 : $put =v:exception[:14]
|
|
408 :endtry
|
|
409 :$put =string(d)
|
|
410 :"
|
|
411 :$put ='No remove() of write-protected scope-level variable:'
|
|
412 :fun! Tfunc(this_is_a_loooooooooong_parameter_name)
|
|
413 : try
|
|
414 : $put =string(remove(a:, 'this_is_a_loooooooooong_parameter_name'))
|
|
415 : $put ='did remove()'
|
|
416 : catch
|
|
417 : $put =v:exception[:14]
|
|
418 : endtry
|
|
419 :endfun
|
|
420 :call Tfunc('testval')
|
|
421 :"
|
|
422 :$put ='No extend() of write-protected scope-level variable:'
|
|
423 :fun! Tfunc(this_is_a_loooooooooong_parameter_name)
|
|
424 : try
|
|
425 : $put =string(extend(a:, {'this_is_a_loooooooooong_parameter_name': 1234}))
|
|
426 : $put ='did extend()'
|
|
427 : catch
|
|
428 : $put =v:exception[:14]
|
|
429 : endtry
|
|
430 :endfun
|
|
431 :call Tfunc('testval')
|
|
432 :"
|
|
433 :$put ='No :unlet of variable in locked scope:'
|
|
434 :let b:testvar = 123
|
|
435 :lockvar 1 b:
|
|
436 :try
|
|
437 : unlet b:testvar
|
|
438 : $put ='b:testvar was :unlet: '. (!exists('b:testvar'))
|
|
439 :catch
|
|
440 : $put =v:exception[:16]
|
|
441 :endtry
|
|
442 :unlockvar 1 b:
|
|
443 :unlet! b:testvar
|
|
444 :"
|
6791
|
445 :$put ='No :let += of locked list variable:'
|
|
446 :let l = ['a', 'b', 3]
|
|
447 :lockvar 1 l
|
|
448 :try
|
|
449 : let l += ['x']
|
|
450 : $put ='did :let +='
|
|
451 :catch
|
|
452 : $put =v:exception[:14]
|
|
453 :endtry
|
|
454 :$put =string(l)
|
|
455 :"
|
6166
|
456 :unlet l
|
|
457 :let l = [1, 2, 3, 4]
|
|
458 :lockvar! l
|
|
459 :$put =string(l)
|
|
460 :unlockvar l[1]
|
|
461 :unlet l[0:1]
|
|
462 :$put =string(l)
|
|
463 :unlet l[1:2]
|
|
464 :$put =string(l)
|
|
465 :unlockvar l[1]
|
|
466 :let l[0:1] = [0, 1]
|
|
467 :$put =string(l)
|
|
468 :let l[1:2] = [0, 1]
|
|
469 :$put =string(l)
|
|
470 :unlet l
|
5604
|
471 :" :lockvar/islocked() triggering script autoloading
|
|
472 :set rtp+=./sautest
|
|
473 :lockvar g:footest#x
|
|
474 :unlockvar g:footest#x
|
|
475 :$put ='locked g:footest#x:'.islocked('g:footest#x')
|
|
476 :$put ='exists g:footest#x:'.exists('g:footest#x')
|
|
477 :$put ='g:footest#x: '.g:footest#x
|
148
|
478 :"
|
|
479 :" a:000 function argument
|
|
480 :" first the tests that should fail
|
|
481 :try
|
|
482 : let a:000 = [1, 2]
|
|
483 :catch
|
|
484 : $put ='caught a:000'
|
|
485 :endtry
|
|
486 :try
|
|
487 : let a:000[0] = 9
|
|
488 :catch
|
|
489 : $put ='caught a:000[0]'
|
|
490 :endtry
|
|
491 :try
|
|
492 : let a:000[2] = [9, 10]
|
|
493 :catch
|
|
494 : $put ='caught a:000[2]'
|
|
495 :endtry
|
|
496 :try
|
|
497 : let a:000[3] = {9: 10}
|
|
498 :catch
|
|
499 : $put ='caught a:000[3]'
|
|
500 :endtry
|
|
501 :" now the tests that should pass
|
|
502 :try
|
|
503 : let a:000[2][1] = 9
|
|
504 : call extend(a:000[2], [5, 6])
|
|
505 : let a:000[3][5] = 8
|
|
506 : let a:000[3]['a'] = 12
|
|
507 : $put =string(a:000)
|
|
508 :catch
|
|
509 : $put ='caught ' . v:exception
|
|
510 :endtry
|
|
511 :"
|
5747
|
512 :" reverse(), sort(), uniq()
|
|
513 :let l = ['-0', 'A11', 2, 2, 'xaaa', 4, 'foo', 'foo6', 'foo', [0, 1, 2], 'x8', [0, 1, 2], 1.5]
|
|
514 :$put =string(uniq(copy(l)))
|
164
|
515 :$put =string(reverse(l))
|
|
516 :$put =string(reverse(reverse(l)))
|
|
517 :$put =string(sort(l))
|
|
518 :$put =string(reverse(sort(l)))
|
|
519 :$put =string(sort(reverse(sort(l))))
|
5747
|
520 :$put =string(uniq(sort(l)))
|
6022
|
521 :let l=[7, 9, 'one', 18, 12, 22, 'two', 10.0e-16, -1, 'three', 0xff, 0.22, 'four']
|
6014
|
522 :$put =string(sort(copy(l), 'n'))
|
6022
|
523 :let l=[7, 9, 18, 12, 22, 10.0e-16, -1, 0xff, 0, -0, 0.22, 'bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', {}, []]
|
6001
|
524 :$put =string(sort(copy(l), 1))
|
|
525 :$put =string(sort(copy(l), 'i'))
|
|
526 :$put =string(sort(copy(l)))
|
164
|
527 :"
|
283
|
528 :" splitting a string to a List
|
|
529 :$put =string(split(' aa bb '))
|
|
530 :$put =string(split(' aa bb ', '\W\+', 0))
|
|
531 :$put =string(split(' aa bb ', '\W\+', 1))
|
|
532 :$put =string(split(' aa bb ', '\W', 1))
|
|
533 :$put =string(split(':aa::bb:', ':', 0))
|
|
534 :$put =string(split(':aa::bb:', ':', 1))
|
|
535 :$put =string(split('aa,,bb, cc,', ',\s*', 1))
|
294
|
536 :$put =string(split('abc', '\zs'))
|
|
537 :$put =string(split('abc', '\zs', 1))
|
283
|
538 :"
|
1125
|
539 :" compare recursively linked list and dict
|
|
540 :let l = [1, 2, 3, 4]
|
|
541 :let d = {'1': 1, '2': l, '3': 3}
|
|
542 :let l[1] = d
|
|
543 :$put =(l == l)
|
|
544 :$put =(d == d)
|
|
545 :$put =(l != deepcopy(l))
|
|
546 :$put =(d != deepcopy(d))
|
2634
|
547 :"
|
|
548 :" compare complex recursively linked list and dict
|
|
549 :let l = []
|
|
550 :call add(l, l)
|
|
551 :let dict4 = {"l": l}
|
|
552 :call add(dict4.l, dict4)
|
|
553 :let lcopy = deepcopy(l)
|
|
554 :let dict4copy = deepcopy(dict4)
|
|
555 :$put =(l == lcopy)
|
|
556 :$put =(dict4 == dict4copy)
|
3508
|
557 :"
|
|
558 :" Pass the same List to extend()
|
|
559 :let l = [1, 2, 3, 4, 5]
|
|
560 :call extend(l, l)
|
|
561 :$put =string(l)
|
|
562 :"
|
|
563 :" Pass the same Dict to extend()
|
|
564 :let d = { 'a': {'b': 'B'}}
|
|
565 :call extend(d, d)
|
|
566 :$put =string(d)
|
|
567 :"
|
|
568 :" Pass the same Dict to extend() with "error"
|
|
569 :try
|
|
570 : call extend(d, d, "error")
|
|
571 :catch
|
|
572 : $put =v:exception[:15] . v:exception[-1:-1]
|
|
573 :endtry
|
|
574 :$put =string(d)
|
6422
|
575 :"
|
|
576 :" test for range assign
|
|
577 :let l = [0]
|
|
578 :let l[:] = [1, 2]
|
|
579 :$put =string(l)
|
119
|
580 :endfun
|
2634
|
581 :"
|
148
|
582 :call Test(1, 2, [3, 4], {5: 6}) " This may take a while
|
119
|
583 :"
|
1405
|
584 :delfunc Test
|
|
585 :unlet dict
|
|
586 :call garbagecollect(1)
|
|
587 :"
|
3774
|
588 :" test for patch 7.3.637
|
|
589 :let a = 'No error caught'
|
|
590 :try|foldopen|catch|let a = matchstr(v:exception,'^[^ ]*')|endtry
|
|
591 o=a
:"
|
|
592 :lang C
|
|
593 :redir => a
|
|
594 :try|foobar|catch|let a = matchstr(v:exception,'^[^ ]*')|endtry
|
|
595 :redir END
|
|
596 o=a
:"
|
|
597 :"
|
119
|
598 :/^start:/,$wq! test.out
|
|
599 ENDTEST
|
|
600
|
|
601 start:
|