1
0
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:
Bram Moolenaar
2019-03-28 21:26:23 +01:00
parent a16123a666
commit 37db642083
2 changed files with 41 additions and 5 deletions

View File

@@ -14,14 +14,48 @@ func Test_complete_list()
endfunc
func Test_complete_wildmenu()
call writefile(['testfile1'], 'Xtestfile1')
call writefile(['testfile2'], 'Xtestfile2')
call mkdir('Xdir1/Xdir2', 'p')
call writefile(['testfile1'], 'Xdir1/Xtestfile1')
call writefile(['testfile2'], 'Xdir1/Xtestfile2')
call writefile(['testfile3'], 'Xdir1/Xdir2/Xtestfile3')
call writefile(['testfile3'], 'Xdir1/Xdir2/Xtestfile4')
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 delete('Xtestfile1')
call delete('Xtestfile2')
" <S-Tab> is like <Tab> but begin with the last match and then go to
" 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
endfunc

View File

@@ -775,6 +775,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1063,
/**/
1062,
/**/