Mercurial > vim
diff src/testdir/test_cmdline.vim @ 16495:899db156cce3 v8.1.1251
patch 8.1.1251: no test for completion of mapping keys
commit https://github.com/vim/vim/commit/2cb9f0253228478ec27265ff40f59c629874d695
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri May 3 15:13:57 2019 +0200
patch 8.1.1251: no test for completion of mapping keys
Problem: No test for completion of mapping keys.
Solution: Add a test. Also clean up the code.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 03 May 2019 15:15:05 +0200 |
parents | dd15295b94fe |
children | ac4e38fbae9d |
line wrap: on
line diff
--- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -77,6 +77,42 @@ func Test_map_completion() call assert_equal('"map <special> <nowait>', getreg(':')) call feedkeys(":map <silent> <sp\<Tab>\<Home>\"\<CR>", 'xt') call assert_equal('"map <silent> <special>', getreg(':')) + + map ,f commaf + map ,g commaf + call feedkeys(":map ,\<Tab>\<Home>\"\<CR>", 'xt') + call assert_equal('"map ,f', getreg(':')) + call feedkeys(":map ,\<Tab>\<Tab>\<Home>\"\<CR>", 'xt') + call assert_equal('"map ,g', getreg(':')) + unmap ,f + unmap ,g + + set cpo-=< cpo-=B cpo-=k + map <Left> left + call feedkeys(":map <L\<Tab>\<Home>\"\<CR>", 'xt') + call assert_equal('"map <Left>', getreg(':')) + unmap <Left> + + set cpo+=< + map <Left> left + call feedkeys(":map <L\<Tab>\<Home>\"\<CR>", 'xt') + call assert_equal('"map <Left>', getreg(':')) + unmap <Left> + set cpo-=< + + set cpo+=B + map <Left> left + call feedkeys(":map <L\<Tab>\<Home>\"\<CR>", 'xt') + call assert_equal('"map <Left>', getreg(':')) + unmap <Left> + set cpo-=B + + set cpo+=k + map <Left> left + call feedkeys(":map <L\<Tab>\<Home>\"\<CR>", 'xt') + call assert_equal('"map <Left>', getreg(':')) + unmap <Left> + set cpo-=k endfunc func Test_match_completion()