From ae3150ec8d9da4a244acffebea55416946ca23d3 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 11 Jun 2016 23:22:36 +0200 Subject: [PATCH] patch 7.4.1923 Problem: Command line editing is not tested much. Solution: Add tests for expanding the file name and 'wildmenu'. --- src/testdir/Make_all.mak | 1 + src/testdir/test_cmdline.vim | 26 ++++++++++++++++++++++++++ src/version.c | 2 ++ 3 files changed, 29 insertions(+) create mode 100644 src/testdir/test_cmdline.vim diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak index 59fff145f..57f8283f0 100644 --- a/src/testdir/Make_all.mak +++ b/src/testdir/Make_all.mak @@ -169,6 +169,7 @@ NEW_TESTS = test_arglist.res \ test_backspace_opt.res \ test_cdo.res \ test_channel.res \ + test_cmdline.res \ test_hardcopy.res \ test_history.res \ test_increment.res \ diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim new file mode 100644 index 000000000..69dc9cdc0 --- /dev/null +++ b/src/testdir/test_cmdline.vim @@ -0,0 +1,26 @@ +" Tests for editing the command line. + +func Test_complete_tab() + call writefile(['testfile'], 'Xtestfile') + call feedkeys(":e Xtest\t\r", "tx") + call assert_equal('testfile', getline(1)) + call delete('Xtestfile') +endfunc + +func Test_complete_list() + " We can't see the output, but at least we check the code runs properly. + call feedkeys(":e test\\r", "tx") + call assert_equal('test', expand('%:t')) +endfunc + +func Test_complete_wildmenu() + call writefile(['testfile1'], 'Xtestfile1') + call writefile(['testfile2'], 'Xtestfile2') + set wildmenu + call feedkeys(":e Xtest\t\t\r", "tx") + call assert_equal('testfile2', getline(1)) + + call delete('Xtestfile1') + call delete('Xtestfile2') + set nowildmenu +endfunc diff --git a/src/version.c b/src/version.c index 39e70e57d..530e36331 100644 --- a/src/version.c +++ b/src/version.c @@ -753,6 +753,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1923, /**/ 1922, /**/ -- 2.50.1