]> granicus.if.org Git - vim/commitdiff
patch 7.4.1923 v7.4.1923
authorBram Moolenaar <Bram@vim.org>
Sat, 11 Jun 2016 21:22:36 +0000 (23:22 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 11 Jun 2016 21:22:36 +0000 (23:22 +0200)
Problem:    Command line editing is not tested much.
Solution:   Add tests for expanding the file name and 'wildmenu'.

src/testdir/Make_all.mak
src/testdir/test_cmdline.vim [new file with mode: 0644]
src/version.c

index 59fff145f0e0913e5d391013e391513ffceaba6a..57f8283f09b0606f5878e56ff6262f0d928b5358 100644 (file)
@@ -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 (file)
index 0000000..69dc9cd
--- /dev/null
@@ -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\<C-D>\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
index 39e70e57d2c4cc489c001702a9626ab8faf545e0..530e36331448b5d4363001f7a07d38d3b5d53266 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1923,
 /**/
     1922,
 /**/