forked from aniani/vim
patch 8.1.1063: insufficient testing for wildmenu completion
Problem: Insufficient testing for wildmenu completion. Solution: Extend the test case. (Dominique Pelle, closes #4182)
This commit is contained in:
@@ -14,14 +14,48 @@ func Test_complete_list()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_complete_wildmenu()
|
func Test_complete_wildmenu()
|
||||||
call writefile(['testfile1'], 'Xtestfile1')
|
call mkdir('Xdir1/Xdir2', 'p')
|
||||||
call writefile(['testfile2'], 'Xtestfile2')
|
call writefile(['testfile1'], 'Xdir1/Xtestfile1')
|
||||||
|
call writefile(['testfile2'], 'Xdir1/Xtestfile2')
|
||||||
|
call writefile(['testfile3'], 'Xdir1/Xdir2/Xtestfile3')
|
||||||
|
call writefile(['testfile3'], 'Xdir1/Xdir2/Xtestfile4')
|
||||||
set wildmenu
|
set wildmenu
|
||||||
call feedkeys(":e Xtest\t\t\r", "tx")
|
|
||||||
|
" Pressing <Tab> completes, and moves to next files when pressing again.
|
||||||
|
call feedkeys(":e Xdir1/\<Tab>\<Tab>\<CR>", 'tx')
|
||||||
|
call assert_equal('testfile1', getline(1))
|
||||||
|
call feedkeys(":e Xdir1/\<Tab>\<Tab>\<Tab>\<CR>", 'tx')
|
||||||
call assert_equal('testfile2', getline(1))
|
call assert_equal('testfile2', getline(1))
|
||||||
|
|
||||||
call delete('Xtestfile1')
|
" <S-Tab> is like <Tab> but begin with the last match and then go to
|
||||||
call delete('Xtestfile2')
|
" previous.
|
||||||
|
call feedkeys(":e Xdir1/Xtest\<S-Tab>\<CR>", 'tx')
|
||||||
|
call assert_equal('testfile2', getline(1))
|
||||||
|
call feedkeys(":e Xdir1/Xtest\<S-Tab>\<S-Tab>\<CR>", 'tx')
|
||||||
|
call assert_equal('testfile1', getline(1))
|
||||||
|
|
||||||
|
" <Left>/<Right> to move to previous/next file.
|
||||||
|
call feedkeys(":e Xdir1/\<Tab>\<Right>\<CR>", 'tx')
|
||||||
|
call assert_equal('testfile1', getline(1))
|
||||||
|
call feedkeys(":e Xdir1/\<Tab>\<Right>\<Right>\<CR>", 'tx')
|
||||||
|
call assert_equal('testfile2', getline(1))
|
||||||
|
call feedkeys(":e Xdir1/\<Tab>\<Right>\<Right>\<Left>\<CR>", 'tx')
|
||||||
|
call assert_equal('testfile1', getline(1))
|
||||||
|
|
||||||
|
" <Up>/<Down> to go up/down directories.
|
||||||
|
call feedkeys(":e Xdir1/\<Tab>\<Down>\<CR>", 'tx')
|
||||||
|
call assert_equal('testfile3', getline(1))
|
||||||
|
call feedkeys(":e Xdir1/\<Tab>\<Down>\<Up>\<Right>\<CR>", 'tx')
|
||||||
|
call assert_equal('testfile1', getline(1))
|
||||||
|
|
||||||
|
" cleanup
|
||||||
|
%bwipe
|
||||||
|
call delete('Xdir1/Xdir2/Xtestfile4')
|
||||||
|
call delete('Xdir1/Xdir2/Xtestfile3')
|
||||||
|
call delete('Xdir1/Xtestfile2')
|
||||||
|
call delete('Xdir1/Xtestfile1')
|
||||||
|
call delete('Xdir1/Xdir2', 'd')
|
||||||
|
call delete('Xdir1', 'd')
|
||||||
set nowildmenu
|
set nowildmenu
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@@ -775,6 +775,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1063,
|
||||||
/**/
|
/**/
|
||||||
1062,
|
1062,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user