@@ -476,6 +476,15 @@ func Test_list_mappings()
476476 call assert_equal ([' n ,n <Nop>' ],
477477 \ execute (' nmap ,n' )- >trim ()- >split (" \n " ))
478478
479+ " verbose map
480+ call assert_match (" \t Last set from .*/test_mapping.vim line \\ d\\ +$" ,
481+ \ execute (' verbose map ,n' )- >trim ()- >split (" \n " )[1 ])
482+
483+ " map to CTRL-V
484+ exe " nmap ,k \<C-V> "
485+ call assert_equal ([' n ,k <Nop>' ],
486+ \ execute (' nmap ,k' )- >trim ()- >split (" \n " ))
487+
479488 nmapclear
480489endfunc
481490
@@ -812,4 +821,36 @@ func Test_abbr_remove()
812821 call assert_equal ({}, maparg (' foo' , ' i' , 1 , 1 ))
813822endfunc
814823
824+ " Trigger an abbreviation using a special key
825+ func Test_abbr_trigger_special ()
826+ new
827+ iabbr teh the
828+ call feedkeys (" iteh\<F2>\<Esc> " , ' xt' )
829+ call assert_equal (' the<F2>' , getline (1 ))
830+ iunab teh
831+ close !
832+ endfunc
833+
834+ " Test for '<' in 'cpoptions'
835+ func Test_map_cpo_special_keycode ()
836+ set cpo -= <
837+ imap x<Bslash> k Test
838+ let d = maparg (' x<Bslash>k' , ' i' , 0 , 1 )
839+ call assert_equal ([' x\k' , ' Test' , ' i' ], [d .lhs, d .rhs, d .mode ])
840+ call feedkeys (" :imap x\<C-A>\<C-B> \" \<CR> " , ' tx' )
841+ call assert_equal (' "imap x\k' , @: )
842+ iunmap x<Bslash> k
843+ set cpo += <
844+ imap x<Bslash> k Test
845+ let d = maparg (' x<Bslash>k' , ' i' , 0 , 1 )
846+ call assert_equal ([' x<Bslash>k' , ' Test' , ' i' ], [d .lhs, d .rhs, d .mode ])
847+ call feedkeys (" :imap x\<C-A>\<C-B> \" \<CR> " , ' tx' )
848+ call assert_equal (' "imap x<Bslash>k' , @: )
849+ iunmap x<Bslash> k
850+ set cpo -= <
851+ " Modifying 'cpo' above adds some default mappings, remove them
852+ mapclear
853+ mapclear !
854+ endfunc
855+
815856" vim: shiftwidth = 2 sts = 2 expandtab
0 commit comments