changeset 14167:3ca818b65cde v8.1.0101

patch 8.1.0101: no test for getcmdwintype() commit https://github.com/vim/vim/commit/81612b7a7dc50a6c0da9f42fa48f1f576a4ad616 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 23 14:55:03 2018 +0200 patch 8.1.0101: no test for getcmdwintype() Problem: No test for getcmdwintype(). Solution: Add a test. (Dominique Pelle, closes https://github.com/vim/vim/issues/3068)
author Christian Brabandt <cb@256bit.org>
date Sat, 23 Jun 2018 15:00:05 +0200
parents 4a570c13f750
children 9efe9dec796a
files src/testdir/test_cmdline.vim src/version.c
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -511,6 +511,22 @@ func Test_getcmdtype()
   cunmap <F6>
 endfunc
 
+func Test_getcmdwintype()
+  call feedkeys("q/:let a = getcmdwintype()\<CR>:q\<CR>", 'x!')
+  call assert_equal('/', a)
+
+  call feedkeys("q?:let a = getcmdwintype()\<CR>:q\<CR>", 'x!')
+  call assert_equal('?', a)
+
+  call feedkeys("q::let a = getcmdwintype()\<CR>:q\<CR>", 'x!')
+  call assert_equal(':', a)
+
+  call feedkeys(":\<C-F>:let a = getcmdwintype()\<CR>:q\<CR>", 'x!')
+  call assert_equal(':', a)
+
+  call assert_equal('', getcmdwintype())
+endfunc
+
 func Test_verbosefile()
   set verbosefile=Xlog
   echomsg 'foo'
--- a/src/version.c
+++ b/src/version.c
@@ -762,6 +762,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    101,
+/**/
     100,
 /**/
     99,