diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-09-19 17:40:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-19 17:40:55 -0400 |
commit | 9f704c88a57cfb797c21c19672ea6617e9673360 (patch) | |
tree | e16e2630d1ed35d32c9af64c7a067be09b39aec8 /src/nvim/testdir/test_functions.vim | |
parent | 905c2eb359fc21995c6c0151b169b43c66b287fa (diff) | |
parent | df46f9197764b92e596ad6a5a8c297edc51dd6f6 (diff) | |
download | rneovim-9f704c88a57cfb797c21c19672ea6617e9673360.tar.gz rneovim-9f704c88a57cfb797c21c19672ea6617e9673360.tar.bz2 rneovim-9f704c88a57cfb797c21c19672ea6617e9673360.zip |
Merge pull request #12938 from janlazo/vim-8.1.0285
vim-patch:8.1.{285,1782,1972,2261,2263},8.2.{240,817,824,1549,1676,1696}
Diffstat (limited to 'src/nvim/testdir/test_functions.vim')
-rw-r--r-- | src/nvim/testdir/test_functions.vim | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index 6b45ac61d1..c29e0410a9 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -1221,6 +1221,24 @@ func Test_reg_executing_and_recording() unlet s:reg_stat endfunc +func Test_getchar() + throw 'skipped: Nvim does not support test_setmouse()' + 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 @@ -1341,3 +1359,22 @@ func Test_readdir() call delete('Xdir', 'rf') endfunc + +" Test for the eval() function +func Test_eval() + call assert_fails("call eval('5 a')", 'E488:') +endfunc + +" Test for the nr2char() function +func Test_nr2char() + " set encoding=latin1 + call assert_equal('@', nr2char(64)) + set encoding=utf8 + call assert_equal('a', nr2char(97, 1)) + call assert_equal('a', nr2char(97, 0)) + + call assert_equal("\x80\xfc\b\xf4\x80\xfeX\x80\xfeX\x80\xfeX", eval('"\<M-' .. nr2char(0x100000) .. '>"')) + call assert_equal("\x80\xfc\b\xfd\x80\xfeX\x80\xfeX\x80\xfeX\x80\xfeX\x80\xfeX", eval('"\<M-' .. nr2char(0x40000000) .. '>"')) +endfunc + +" vim: shiftwidth=2 sts=2 expandtab |