diff options
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/Makefile | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_usercommands.vim | 48 |
2 files changed, 49 insertions, 0 deletions
diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 4979aae57a..b7aacc7b3b 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -36,6 +36,7 @@ NEW_TESTS = \ test_help_tagjump.res \ test_langmap.res \ test_syntax.res \ + test_usercommands.res \ test_timers.res \ test_viml.res \ test_visual.res \ diff --git a/src/nvim/testdir/test_usercommands.vim b/src/nvim/testdir/test_usercommands.vim new file mode 100644 index 0000000000..f593d16dbf --- /dev/null +++ b/src/nvim/testdir/test_usercommands.vim @@ -0,0 +1,48 @@ +" Tests for user defined commands + +" Test for <mods> in user defined commands +function Test_cmdmods() + let g:mods = '' + + command! -nargs=* MyCmd let g:mods .= '<mods> ' + + MyCmd + aboveleft MyCmd + belowright MyCmd + botright MyCmd + browse MyCmd + confirm MyCmd + hide MyCmd + keepalt MyCmd + keepjumps MyCmd + keepmarks MyCmd + keeppatterns MyCmd + lockmarks MyCmd + noswapfile MyCmd + silent MyCmd + tab MyCmd + topleft MyCmd + verbose MyCmd + vertical MyCmd + + aboveleft belowright botright browse confirm hide keepalt keepjumps + \ keepmarks keeppatterns lockmarks noswapfile silent tab + \ topleft verbose vertical MyCmd + + call assert_equal(' aboveleft belowright botright browse confirm ' . + \ 'hide keepalt keepjumps keepmarks keeppatterns lockmarks ' . + \ 'noswapfile silent tab topleft verbose vertical aboveleft ' . + \ 'belowright botright browse confirm hide keepalt keepjumps ' . + \ 'keepmarks keeppatterns lockmarks noswapfile silent tab topleft ' . + \ 'verbose vertical ', g:mods) + + let g:mods = '' + command! -nargs=* MyQCmd let g:mods .= '<q-mods> ' + + vertical MyQCmd + call assert_equal('"vertical" ', g:mods) + + delcommand MyCmd + delcommand MyQCmd + unlet g:mods +endfunction |