summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_cmdline.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-03 15:13:57 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-03 15:13:57 +0200
commit2cb9f0253228478ec27265ff40f59c629874d695 (patch)
tree080e9fd1c1fbb7aa76c23ffe77872cef0b0f9d97 /src/testdir/test_cmdline.vim
parentd788543ac6996536c532bceb7bbff51cd38d8699 (diff)
patch 8.1.1251: no test for completion of mapping keysv8.1.1251
Problem: No test for completion of mapping keys. Solution: Add a test. Also clean up the code.
Diffstat (limited to 'src/testdir/test_cmdline.vim')
-rw-r--r--src/testdir/test_cmdline.vim36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim
index 3a849cbd15..f9fd80d2db 100644
--- 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()