aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_langmap.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-04-30 14:00:53 +0800
committerGitHub <noreply@github.com>2022-04-30 14:00:53 +0800
commitde2232878fb95bdb84f8219c7cf1d7f2c2828086 (patch)
tree262ce916b48839d98133a0b6a2570e96865ce94f /src/nvim/testdir/test_langmap.vim
parent2ba539f449a95f38463a61b189e203a5fe306fc0 (diff)
downloadrneovim-de2232878fb95bdb84f8219c7cf1d7f2c2828086.tar.gz
rneovim-de2232878fb95bdb84f8219c7cf1d7f2c2828086.tar.bz2
rneovim-de2232878fb95bdb84f8219c7cf1d7f2c2828086.zip
vim-patch:8.2.0144: some mapping code is not fully tested (#18313)
Problem: Some mapping code is not fully tested. Solution: Add more test cases. (Yegappan Lakshmanan, closes vim/vim#5519) https://github.com/vim/vim/commit/c2a60ae10e7badad9186de59a9994fc8c9f539e0
Diffstat (limited to 'src/nvim/testdir/test_langmap.vim')
-rw-r--r--src/nvim/testdir/test_langmap.vim27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_langmap.vim b/src/nvim/testdir/test_langmap.vim
index 066c3bf2bd..eca8a95564 100644
--- a/src/nvim/testdir/test_langmap.vim
+++ b/src/nvim/testdir/test_langmap.vim
@@ -20,5 +20,32 @@ func Test_langmap()
silent! call feedkeys("gg0}%}\<C-G>}^\<Esc>00", 'tx')
call assert_equal('a}^de', getline(1))
+ " Error cases
+ call assert_fails('set langmap=aA,b', 'E357:')
+ call assert_fails('set langmap=z;y;y;z', 'E358:')
+
+ " Map character > 256
+ enew!
+ set langmap=āx,ăl,āx
+ call setline(1, ['abcde'])
+ call feedkeys('gg2lā', 'tx')
+ call assert_equal('abde', getline(1))
+
+ " special characters in langmap
+ enew!
+ call setline(1, ['Hello World'])
+ set langmap=\\;\\,,\\,\\;
+ call feedkeys('ggfo,', 'tx')
+ call assert_equal(8, col('.'))
+ call feedkeys(';', 'tx')
+ call assert_equal(5, col('.'))
+ set langmap&
+ set langmap=\\;\\,;\\,\\;
+ call feedkeys('ggfo,', 'tx')
+ call assert_equal(8, col('.'))
+ call feedkeys(';', 'tx')
+ call assert_equal(5, col('.'))
+
+ set langmap&
quit!
endfunc