diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-12-25 23:26:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-25 23:26:59 -0500 |
commit | 9dd8557921ec94035971a3145ab744add858459a (patch) | |
tree | ae58196b839f3b1c6adc19e5da591d6ba46a5eb5 /src/nvim/testdir | |
parent | 333dd6f80bc4345f72331f380a1010cfb2b6c621 (diff) | |
parent | 599a3d6abd29f4be9704361ea9e55656ac331a9b (diff) | |
download | rneovim-9dd8557921ec94035971a3145ab744add858459a.tar.gz rneovim-9dd8557921ec94035971a3145ab744add858459a.tar.bz2 rneovim-9dd8557921ec94035971a3145ab744add858459a.zip |
Merge pull request #16774 from zeertzjq/vim-8.2.2468
vim-patch:8.2.2468: not easy to get the full command name from a shortened one
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/test_cmdline.vim | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index 49a5386337..1672b0e840 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -467,6 +467,43 @@ func Test_getcompletion() call assert_fails('call getcompletion("abc", [])', 'E475:') endfunc +func Test_fullcommand() + let tests = { + \ '': '', + \ ':': '', + \ ':::': '', + \ ':::5': '', + \ 'not_a_cmd': '', + \ 'Check': '', + \ 'syntax': 'syntax', + \ ':syntax': 'syntax', + \ '::::syntax': 'syntax', + \ 'sy': 'syntax', + \ 'syn': 'syntax', + \ 'synt': 'syntax', + \ ':sy': 'syntax', + \ '::::sy': 'syntax', + \ 'match': 'match', + \ '2match': 'match', + \ '3match': 'match', + \ 'aboveleft': 'aboveleft', + \ 'abo': 'aboveleft', + \ 's': 'substitute', + \ '5s': 'substitute', + \ ':5s': 'substitute', + \ "'<,'>s": 'substitute', + \ ":'<,'>s": 'substitute', + \ 'CheckUni': 'CheckUnix', + \ 'CheckUnix': 'CheckUnix', + \ } + + for [in, want] in items(tests) + call assert_equal(want, fullcommand(in)) + endfor + + call assert_equal('syntax', 'syn'->fullcommand()) +endfunc + func Test_shellcmd_completion() let save_path = $PATH |