aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-08-04 19:12:35 -0400
committerJustin M. Keyes <justinkz@gmail.com>2019-08-05 01:12:35 +0200
commita724209b5a34e40fe2fff338ff7c5db2bc395bbc (patch)
tree611f76a05587cc6ef5edce26bf9215350c55a886 /src/nvim/testdir
parent4c35e6fe6734050b2e633aba330b0e389835fbc4 (diff)
downloadrneovim-a724209b5a34e40fe2fff338ff7c5db2bc395bbc.tar.gz
rneovim-a724209b5a34e40fe2fff338ff7c5db2bc395bbc.tar.bz2
rneovim-a724209b5a34e40fe2fff338ff7c5db2bc395bbc.zip
vim-patch:8.1.1251: test completion of mapping keys #10691
Problem: No test for completion of mapping keys. Solution: Add a test. Also clean up the code. https://github.com/vim/vim/commit/2cb9f0253228478ec27265ff40f59c629874d695
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_cmdline.vim36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim
index eb18284b4a..4b333e444a 100644
--- a/src/nvim/testdir/test_cmdline.vim
+++ b/src/nvim/testdir/test_cmdline.vim
@@ -44,6 +44,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()