]> granicus.if.org Git - vim/commitdiff
patch 8.1.1972: no proper test for getchar() v8.1.1972
authorBram Moolenaar <Bram@vim.org>
Tue, 3 Sep 2019 21:37:01 +0000 (23:37 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 3 Sep 2019 21:37:01 +0000 (23:37 +0200)
Problem:    No proper test for getchar().
Solution:   Add a test with special characters.

src/testdir/test_functions.vim
src/version.c

index 20718bcc0791651a0c3d51ed385d2264cfc31b67..d5ce5f02bf75b6fb76a509cbcf71498cbd6ca9b1 100644 (file)
@@ -1314,6 +1314,23 @@ func Test_inputsecret()
   unlet g:typed2
 endfunc
 
+func Test_getchar()
+  call feedkeys('a', '')
+  call assert_equal(char2nr('a'), getchar())
+
+  call test_setmouse(1, 3)
+  let v:mouse_win = 9
+  let v:mouse_winid = 9
+  let v:mouse_lnum = 9
+  let v:mouse_col = 9
+  call feedkeys("\<S-LeftMouse>", '')
+  call assert_equal("\<S-LeftMouse>", getchar())
+  call assert_equal(1, v:mouse_win)
+  call assert_equal(win_getid(1), v:mouse_winid)
+  call assert_equal(1, v:mouse_lnum)
+  call assert_equal(3, v:mouse_col)
+endfunc
+
 func Test_libcall_libcallnr()
   if !has('libcall')
     return
index 85526b66bd8e9eafccdf662c4568d14e4c187a2e..321da5103a0f065be9fab75b06d16388ef925f17 100644 (file)
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1972,
 /**/
     1971,
 /**/