comparison src/testdir/test_maparg.vim @ 19170:ad40333f2ec0 v8.2.0144

patch 8.2.0144: some mapping code is not fully tested Commit: https://github.com/vim/vim/commit/c2a60ae10e7badad9186de59a9994fc8c9f539e0 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 23 16:19:54 2020 +0100 patch 8.2.0144: some mapping code is not fully tested Problem: Some mapping code is not fully tested. Solution: Add more test cases. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5519)
author Bram Moolenaar <Bram@vim.org>
date Thu, 23 Jan 2020 16:30:04 +0100
parents 643c6c3c0da4
children 658248b68f7c
comparison
equal deleted inserted replaced
19169:cc6d4aa341fd 19170:ad40333f2ec0
45 omap { w 45 omap { w
46 let d = maparg('{', 'o', 0, 1) 46 let d = maparg('{', 'o', 0, 1)
47 call assert_equal(['{', 'w', 'o'], [d.lhs, d.rhs, d.mode]) 47 call assert_equal(['{', 'w', 'o'], [d.lhs, d.rhs, d.mode])
48 ounmap { 48 ounmap {
49 49
50 lmap { w
51 let d = maparg('{', 'l', 0, 1)
52 call assert_equal(['{', 'w', 'l'], [d.lhs, d.rhs, d.mode])
53 lunmap {
54
55 nmap { w
56 let d = maparg('{', 'n', 0, 1)
57 call assert_equal(['{', 'w', 'n'], [d.lhs, d.rhs, d.mode])
58 nunmap {
59
60 xmap { w
61 let d = maparg('{', 'x', 0, 1)
62 call assert_equal(['{', 'w', 'x'], [d.lhs, d.rhs, d.mode])
63 xunmap {
64
65 smap { w
66 let d = maparg('{', 's', 0, 1)
67 call assert_equal(['{', 'w', 's'], [d.lhs, d.rhs, d.mode])
68 sunmap {
69
50 map abc <Nop> 70 map abc <Nop>
51 call assert_equal("<Nop>", maparg('abc')) 71 call assert_equal("<Nop>", maparg('abc'))
52 unmap abc 72 unmap abc
73
74 call feedkeys(":abbr esc \<C-V>\<C-V>\<C-V>\<C-V>\<C-V>\<Esc>\<CR>", "xt")
75 let d = maparg('esc', 'i', 1, 1)
76 call assert_equal(['esc', "\<C-V>\<C-V>\<Esc>", '!'], [d.lhs, d.rhs, d.mode])
77 abclear
53 endfunction 78 endfunction
54 79
55 func Test_mapcheck() 80 func Test_mapcheck()
56 call assert_equal('', mapcheck('a')) 81 call assert_equal('', mapcheck('a'))
57 call assert_equal('', mapcheck('abc')) 82 call assert_equal('', mapcheck('abc'))