diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-04-30 14:00:53 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-30 14:00:53 +0800 |
| commit | de2232878fb95bdb84f8219c7cf1d7f2c2828086 (patch) | |
| tree | 262ce916b48839d98133a0b6a2570e96865ce94f /src/nvim/testdir/test_maparg.vim | |
| parent | 2ba539f449a95f38463a61b189e203a5fe306fc0 (diff) | |
| download | rneovim-de2232878fb95bdb84f8219c7cf1d7f2c2828086.tar.gz rneovim-de2232878fb95bdb84f8219c7cf1d7f2c2828086.tar.bz2 rneovim-de2232878fb95bdb84f8219c7cf1d7f2c2828086.zip | |
vim-patch:8.2.0144: some mapping code is not fully tested (#18313)
Problem: Some mapping code is not fully tested.
Solution: Add more test cases. (Yegappan Lakshmanan, closes vim/vim#5519)
https://github.com/vim/vim/commit/c2a60ae10e7badad9186de59a9994fc8c9f539e0
Diffstat (limited to 'src/nvim/testdir/test_maparg.vim')
| -rw-r--r-- | src/nvim/testdir/test_maparg.vim | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_maparg.vim b/src/nvim/testdir/test_maparg.vim index 5b082198cf..cebde89996 100644 --- a/src/nvim/testdir/test_maparg.vim +++ b/src/nvim/testdir/test_maparg.vim @@ -47,9 +47,34 @@ function Test_maparg() call assert_equal(['{', 'w', 'o'], [d.lhs, d.rhs, d.mode]) ounmap { + lmap { w + let d = maparg('{', 'l', 0, 1) + call assert_equal(['{', 'w', 'l'], [d.lhs, d.rhs, d.mode]) + lunmap { + + nmap { w + let d = maparg('{', 'n', 0, 1) + call assert_equal(['{', 'w', 'n'], [d.lhs, d.rhs, d.mode]) + nunmap { + + xmap { w + let d = maparg('{', 'x', 0, 1) + call assert_equal(['{', 'w', 'x'], [d.lhs, d.rhs, d.mode]) + xunmap { + + smap { w + let d = maparg('{', 's', 0, 1) + call assert_equal(['{', 'w', 's'], [d.lhs, d.rhs, d.mode]) + sunmap { + map abc <Nop> call assert_equal("<Nop>", maparg('abc')) unmap abc + + call feedkeys(":abbr esc \<C-V>\<C-V>\<C-V>\<C-V>\<C-V>\<Esc>\<CR>", "xt") + let d = maparg('esc', 'i', 1, 1) + call assert_equal(['esc', "\<C-V>\<C-V>\<Esc>", '!'], [d.lhs, d.rhs, d.mode]) + abclear endfunction func Test_mapcheck() |