Mercurial > vim
comparison src/testdir/test_functions.vim @ 17952:4754339d9aee v8.1.1972
patch 8.1.1972: no proper test for getchar()
Commit: https://github.com/vim/vim/commit/5d712e4672c6c8cf7f35cfb7d8eb7e8aa24062ac
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Sep 3 23:37:01 2019 +0200
patch 8.1.1972: no proper test for getchar()
Problem: No proper test for getchar().
Solution: Add a test with special characters.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 03 Sep 2019 23:45:04 +0200 |
parents | 745c02392844 |
children | 6d11a0d5751d |
comparison
equal
deleted
inserted
replaced
17951:d340eabb6705 | 17952:4754339d9aee |
---|---|
1312 unmap W | 1312 unmap W |
1313 unlet g:typed1 | 1313 unlet g:typed1 |
1314 unlet g:typed2 | 1314 unlet g:typed2 |
1315 endfunc | 1315 endfunc |
1316 | 1316 |
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 | |
1317 func Test_libcall_libcallnr() | 1334 func Test_libcall_libcallnr() |
1318 if !has('libcall') | 1335 if !has('libcall') |
1319 return | 1336 return |
1320 endif | 1337 endif |
1321 | 1338 |