1
0
forked from aniani/vim

patch 8.2.0712: various code not fully tested

Problem:    Various code not fully tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes #6049)
This commit is contained in:
Bram Moolenaar
2020-05-07 18:43:44 +02:00
parent b2d0e51366
commit 0ff5dedf0f
5 changed files with 83 additions and 0 deletions

View File

@@ -1371,4 +1371,30 @@ func Test_cmdline_literal()
set timeoutlen&
endfunc
" Test for translation of special key codes (<xF1>, <xF2>, etc.)
func Test_Keycode_Tranlsation()
let keycodes = [
\ ["<xUp>", "<Up>"],
\ ["<xDown>", "<Down>"],
\ ["<xLeft>", "<Left>"],
\ ["<xRight>", "<Right>"],
\ ["<xHome>", "<Home>"],
\ ["<xEnd>", "<End>"],
\ ["<zHome>", "<Home>"],
\ ["<zEnd>", "<End>"],
\ ["<xF1>", "<F1>"],
\ ["<xF2>", "<F2>"],
\ ["<xF3>", "<F3>"],
\ ["<xF4>", "<F4>"],
\ ["<S-xF1>", "<S-F1>"],
\ ["<S-xF2>", "<S-F2>"],
\ ["<S-xF3>", "<S-F3>"],
\ ["<S-xF4>", "<S-F4>"]]
for [k1, k2] in keycodes
exe "nnoremap " .. k1 .. " 2wx"
call assert_true(maparg(k1, 'n', 0, 1).lhs == k2)
exe "nunmap " .. k1
endfor
endfunc
" vim: shiftwidth=2 sts=2 expandtab