comparison src/testdir/test_cmdline.vim @ 20745:49673325ca13 v8.2.0925

patch 8.2.0925: getcompletion() does not return command line arguments Commit: https://github.com/vim/vim/commit/1f1fd44ef796dd909ff5f3e5288b3fd79294dc71 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 7 18:45:14 2020 +0200 patch 8.2.0925: getcompletion() does not return command line arguments Problem: Getcompletion() does not return command line arguments. Solution: Add the "cmdline" option. (Shougo, closes https://github.com/vim/vim/issues/1140)
author Bram Moolenaar <Bram@vim.org>
date Sun, 07 Jun 2020 19:00:03 +0200
parents fa6f1c97813f
children 32f24b8c9c2d
comparison
equal deleted inserted replaced
20744:e4fd0c87abd0 20745:49673325ca13
353 call assert_equal(cmds, l) 353 call assert_equal(cmds, l)
354 let l = getcompletion('list ', 'sign') 354 let l = getcompletion('list ', 'sign')
355 call assert_equal(['Testing'], l) 355 call assert_equal(['Testing'], l)
356 endif 356 endif
357 357
358 " Command line completion tests
359 let l = getcompletion('cd ', 'cmdline')
360 call assert_true(index(l, 'samples/') >= 0)
361 let l = getcompletion('cd NoMatch', 'cmdline')
362 call assert_equal([], l)
363 let l = getcompletion('let v:n', 'cmdline')
364 call assert_true(index(l, 'v:null') >= 0)
365 let l = getcompletion('let v:notexists', 'cmdline')
366 call assert_equal([], l)
367 let l = getcompletion('call tag', 'cmdline')
368 call assert_true(index(l, 'taglist(') >= 0)
369 let l = getcompletion('call paint', 'cmdline')
370 call assert_equal([], l)
371
358 " For others test if the name is recognized. 372 " For others test if the name is recognized.
359 let names = ['buffer', 'environment', 'file_in_path', 'mapping', 'tag', 'tag_listfiles', 'user'] 373 let names = ['buffer', 'environment', 'file_in_path', 'mapping', 'tag', 'tag_listfiles', 'user']
360 if has('cmdline_hist') 374 if has('cmdline_hist')
361 call add(names, 'history') 375 call add(names, 'history')
362 endif 376 endif
377 391
378 call delete('Xtags') 392 call delete('Xtags')
379 set tags& 393 set tags&
380 394
381 call assert_fails('call getcompletion("", "burp")', 'E475:') 395 call assert_fails('call getcompletion("", "burp")', 'E475:')
382 call assert_fails('call getcompletion("abc", [])', 'E474:') 396 call assert_fails('call getcompletion("abc", [])', 'E475:')
383 endfunc 397 endfunc
384 398
385 func Test_shellcmd_completion() 399 func Test_shellcmd_completion()
386 let save_path = $PATH 400 let save_path = $PATH
387 401