Skip to content

Commit 5d712e4

Browse files
committed
patch 8.1.1972: no proper test for getchar()
Problem: No proper test for getchar(). Solution: Add a test with special characters.
1 parent d570ab9 commit 5d712e4

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

src/testdir/test_functions.vim

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,6 +1314,23 @@ func Test_inputsecret()
13141314
unlet g:typed2
13151315
endfunc
13161316

1317+
func Test_getchar()
1318+
call feedkeys('a', '')
1319+
call assert_equal(char2nr('a'), getchar())
1320+
1321+
call test_setmouse(1, 3)
1322+
let v:mouse_win = 9
1323+
let v:mouse_winid = 9
1324+
let v:mouse_lnum = 9
1325+
let v:mouse_col = 9
1326+
call feedkeys("\<S-LeftMouse>", '')
1327+
call assert_equal("\<S-LeftMouse>", getchar())
1328+
call assert_equal(1, v:mouse_win)
1329+
call assert_equal(win_getid(1), v:mouse_winid)
1330+
call assert_equal(1, v:mouse_lnum)
1331+
call assert_equal(3, v:mouse_col)
1332+
endfunc
1333+
13171334
func Test_libcall_libcallnr()
13181335
if !has('libcall')
13191336
return

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ static char *(features[]) =
761761

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
1972,
764766
/**/
765767
1971,
766768
/**/

0 commit comments

Comments
 (0)