diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-03-28 21:26:23 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-03-28 21:26:23 +0100 |
commit | 37db642083398da7d04ed45767cc46daf40bf72b (patch) | |
tree | e424daff07fce29a9444dd9ea319c411e2b548aa /src | |
parent | a16123a666b4656543614cb5bdaa69ea69f35d30 (diff) |
patch 8.1.1063: insufficient testing for wildmenu completionv8.1.1063
Problem: Insufficient testing for wildmenu completion.
Solution: Extend the test case. (Dominique Pelle, closes #4182)
Diffstat (limited to 'src')
-rw-r--r-- | src/testdir/test_cmdline.vim | 44 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 41 insertions, 5 deletions
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index 02eeb6b8c6..3a849cbd15 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -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)) + + " <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)) - call delete('Xtestfile1') - call delete('Xtestfile2') + " <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 diff --git a/src/version.c b/src/version.c index 3880b7e632..1fa7429805 100644 --- a/src/version.c +++ b/src/version.c @@ -776,6 +776,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1063, +/**/ 1062, /**/ 1061, |