summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-06-04 22:08:55 +0200
committerBram Moolenaar <Bram@vim.org>2016-06-04 22:08:55 +0200
commit63a60ded3fd584847a05dccf058026e682abad90 (patch)
treea467aacf9d2d597d2cb57dc2081a1a2c3be85671 /src/testdir
parentfd89d7ea81b18d32363456b16258174dc9e095dc (diff)
downloadvim-git-63a60ded3fd584847a05dccf058026e682abad90.tar.gz
patch 7.4.1898v7.4.1898
Problem: User commands don't support modifiers. Solution: Add the <mods> item. (Yegappan Lakshmanan, closes #829)
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/Make_all.mak1
-rw-r--r--src/testdir/test_usercommands.vim48
2 files changed, 49 insertions, 0 deletions
diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak
index 0e4ab7f52..59fff145f 100644
--- a/src/testdir/Make_all.mak
+++ b/src/testdir/Make_all.mak
@@ -179,6 +179,7 @@ NEW_TESTS = test_arglist.res \
test_perl.res \
test_quickfix.res \
test_syntax.res \
+ test_usercommands.res \
test_viminfo.res \
test_viml.res \
test_visual.res \
diff --git a/src/testdir/test_usercommands.vim b/src/testdir/test_usercommands.vim
new file mode 100644
index 000000000..a3c5b9572
--- /dev/null
+++ b/src/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