comparison src/testdir/test60.in @ 625:81fe2ccc1207 v7.0179

updated for version 7.0179
author vimboss
date Thu, 12 Jan 2006 23:22:24 +0000
parents 9e359e5759f6
children a5677b7ce858
comparison
equal deleted inserted replaced
624:91e7d4a7b3b0 625:81fe2ccc1207
49 49
50 " Existing and working option (long form) 50 " Existing and working option (long form)
51 let test_cases += [['&textwidth', 1]] 51 let test_cases += [['&textwidth', 1]]
52 " Existing and working option (short form) 52 " Existing and working option (short form)
53 let test_cases += [['&tw', 1]] 53 let test_cases += [['&tw', 1]]
54 " Global option
55 let test_cases += [['&g:errorformat', 1]]
56 " Local option
57 let test_cases += [['&l:errorformat', 1]]
54 " Negative form of existing and working option (long form) 58 " Negative form of existing and working option (long form)
55 let test_cases += [['&nojoinspaces', 0]] 59 let test_cases += [['&nojoinspaces', 0]]
56 " Negative form of existing and working option (short form) 60 " Negative form of existing and working option (short form)
57 let test_cases += [['&nojs', 0]] 61 let test_cases += [['&nojs', 0]]
58 " Non-existing option 62 " Non-existing option
210 echo "OK" 214 echo "OK"
211 else 215 else
212 echo "FAILED" 216 echo "FAILED"
213 endif 217 endif
214 218
219 " Existing local curly-brace variable
220 let str = "local"
221 let curly_{str}_var = 1
222 echo 'curly_' . str . '_var: 1'
223 if exists('curly_{str}_var')
224 echo "OK"
225 else
226 echo "FAILED"
227 endif
228
229 " Non-existing local curly-brace variable
230 unlet curly_{str}_var
231 echo 'curly_' . str . '_var: 0'
232 if !exists('curly_{str}_var')
233 echo "OK"
234 else
235 echo "FAILED"
236 endif
237
238
215 " Existing global variable 239 " Existing global variable
216 let g:global_var = 1 240 let g:global_var = 1
217 echo 'g:global_var: 1' 241 echo 'g:global_var: 1'
218 if exists('g:global_var') 242 if exists('g:global_var')
219 echo "OK" 243 echo "OK"
228 echo "OK" 252 echo "OK"
229 else 253 else
230 echo "FAILED" 254 echo "FAILED"
231 endif 255 endif
232 256
233 " Existing local curly-brace variable 257 " Existing global list
234 let curly_local_var = 1 258 let g:global_list = ["blue", "orange"]
235 let str = "local" 259 echo 'g:global_list: 1'
236 echo 'curly_{str}_var: 1' 260 if exists('g:global_list')
237 if exists('curly_{str}_var') 261 echo "OK"
238 echo "OK" 262 else
239 else 263 echo "FAILED"
240 echo "FAILED" 264 endif
241 endif 265
242 266 " Non-existing global list
243 " Non-existing local curly-brace variable 267 unlet g:global_list
244 unlet curly_local_var 268 echo 'g:global_list: 0'
245 echo 'curly_{str}_var: 0' 269 if !exists('g:global_list')
246 if !exists('curly_{str}_var') 270 echo "OK"
271 else
272 echo "FAILED"
273 endif
274
275 " Existing global dictionary
276 let g:global_dict = {"xcord":100, "ycord":2}
277 echo 'g:global_dict: 1'
278 if exists('g:global_dict')
279 echo "OK"
280 else
281 echo "FAILED"
282 endif
283
284 " Non-existing global dictionary
285 unlet g:global_dict
286 echo 'g:global_dict: 0'
287 if !exists('g:global_dict')
247 echo "OK" 288 echo "OK"
248 else 289 else
249 echo "FAILED" 290 echo "FAILED"
250 endif 291 endif
251 292
252 " Existing global curly-brace variable 293 " Existing global curly-brace variable
253 let g:curly_global_var = 1
254 let str = "global" 294 let str = "global"
255 echo 'g:curly_{str}_var: 1' 295 let g:curly_{str}_var = 1
296 echo 'g:curly_' . str . '_var: 1'
256 if exists('g:curly_{str}_var') 297 if exists('g:curly_{str}_var')
257 echo "OK" 298 echo "OK"
258 else 299 else
259 echo "FAILED" 300 echo "FAILED"
260 endif 301 endif
261 302
262 " Non-existing global curly-brace variable 303 " Non-existing global curly-brace variable
263 unlet g:curly_global_var 304 unlet g:curly_{str}_var
264 echo 'g:curly_{str}_var: 0' 305 echo 'g:curly_' . str . '_var: 0'
265 if !exists('g:curly_{str}_var') 306 if !exists('g:curly_{str}_var')
307 echo "OK"
308 else
309 echo "FAILED"
310 endif
311
312 " Existing window variable
313 echo 'w:window_var: 1'
314 let w:window_var = 1
315 if exists('w:window_var')
316 echo "OK"
317 else
318 echo "FAILED"
319 endif
320
321 " Non-existing window variable
322 unlet w:window_var
323 echo 'w:window_var: 0'
324 if !exists('w:window_var')
325 echo "OK"
326 else
327 echo "FAILED"
328 endif
329
330 " Existing window list
331 let w:window_list = ["blue", "orange"]
332 echo 'w:window_list: 1'
333 if exists('w:window_list')
334 echo "OK"
335 else
336 echo "FAILED"
337 endif
338
339 " Non-existing window list
340 unlet w:window_list
341 echo 'w:window_list: 0'
342 if !exists('w:window_list')
343 echo "OK"
344 else
345 echo "FAILED"
346 endif
347
348 " Existing window dictionary
349 let w:window_dict = {"xcord":100, "ycord":2}
350 echo 'w:window_dict: 1'
351 if exists('w:window_dict')
352 echo "OK"
353 else
354 echo "FAILED"
355 endif
356
357 " Non-existing window dictionary
358 unlet w:window_dict
359 echo 'w:window_dict: 0'
360 if !exists('w:window_dict')
361 echo "OK"
362 else
363 echo "FAILED"
364 endif
365
366 " Existing window curly-brace variable
367 let str = "window"
368 let w:curly_{str}_var = 1
369 echo 'w:curly_' . str . '_var: 1'
370 if exists('w:curly_{str}_var')
371 echo "OK"
372 else
373 echo "FAILED"
374 endif
375
376 " Non-existing window curly-brace variable
377 unlet w:curly_{str}_var
378 echo 'w:curly_' . str . '_var: 0'
379 if !exists('w:curly_{str}_var')
380 echo "OK"
381 else
382 echo "FAILED"
383 endif
384
385 " Existing buffer variable
386 echo 'b:buffer_var: 1'
387 let b:buffer_var = 1
388 if exists('b:buffer_var')
389 echo "OK"
390 else
391 echo "FAILED"
392 endif
393
394 " Non-existing buffer variable
395 unlet b:buffer_var
396 echo 'b:buffer_var: 0'
397 if !exists('b:buffer_var')
398 echo "OK"
399 else
400 echo "FAILED"
401 endif
402
403 " Existing buffer list
404 let b:buffer_list = ["blue", "orange"]
405 echo 'b:buffer_list: 1'
406 if exists('b:buffer_list')
407 echo "OK"
408 else
409 echo "FAILED"
410 endif
411
412 " Non-existing buffer list
413 unlet b:buffer_list
414 echo 'b:buffer_list: 0'
415 if !exists('b:buffer_list')
416 echo "OK"
417 else
418 echo "FAILED"
419 endif
420
421 " Existing buffer dictionary
422 let b:buffer_dict = {"xcord":100, "ycord":2}
423 echo 'b:buffer_dict: 1'
424 if exists('b:buffer_dict')
425 echo "OK"
426 else
427 echo "FAILED"
428 endif
429
430 " Non-existing buffer dictionary
431 unlet b:buffer_dict
432 echo 'b:buffer_dict: 0'
433 if !exists('b:buffer_dict')
434 echo "OK"
435 else
436 echo "FAILED"
437 endif
438
439 " Existing buffer curly-brace variable
440 let str = "buffer"
441 let b:curly_{str}_var = 1
442 echo 'b:curly_' . str . '_var: 1'
443 if exists('b:curly_{str}_var')
444 echo "OK"
445 else
446 echo "FAILED"
447 endif
448
449 " Non-existing buffer curly-brace variable
450 unlet b:curly_{str}_var
451 echo 'b:curly_' . str . '_var: 0'
452 if !exists('b:curly_{str}_var')
266 echo "OK" 453 echo "OK"
267 else 454 else
268 echo "FAILED" 455 echo "FAILED"
269 endif 456 endif
270 457
271 " Script-local tests 458 " Script-local tests
272 source test60.vim 459 source test60.vim
460
461 " Existing Vim internal variable
462 echo 'v:version: 1'
463 if exists('v:version')
464 echo "OK"
465 else
466 echo "FAILED"
467 endif
468
469 " Non-existing Vim internal variable
470 echo 'v:non_exists_var: 0'
471 if !exists('v:non_exists_var')
472 echo "OK"
473 else
474 echo "FAILED"
475 endif
476
477 " Function arguments
478 function TestFuncArg(func_arg, ...)
479 echo 'a:func_arg: 1'
480 if exists('a:func_arg')
481 echo "OK"
482 else
483 echo "FAILED"
484 endif
485
486 echo 'a:non_exists_arg: 0'
487 if !exists('a:non_exists_arg')
488 echo "OK"
489 else
490 echo "FAILED"
491 endif
492
493 echo 'a:1: 1'
494 if exists('a:1')
495 echo "OK"
496 else
497 echo "FAILED"
498 endif
499
500 echo 'a:2: 0'
501 if !exists('a:2')
502 echo "OK"
503 else
504 echo "FAILED"
505 endif
506 endfunction
507
508 call TestFuncArg("arg1", "arg2")
273 509
274 redir END 510 redir END
275 endfunction 511 endfunction
276 :call TestExists() 512 :call TestExists()
277 :edit! test.out 513 :edit! test.out