1" Tests for user defined commands
2
3" Test for <mods> in user defined commands
4function Test_cmdmods()
5  let g:mods = ''
6
7  command! -nargs=* MyCmd let g:mods .= '<mods> '
8
9  MyCmd
10  aboveleft MyCmd
11  belowright MyCmd
12  botright MyCmd
13  browse MyCmd
14  confirm MyCmd
15  hide MyCmd
16  keepalt MyCmd
17  keepjumps MyCmd
18  keepmarks MyCmd
19  keeppatterns MyCmd
20  lockmarks MyCmd
21  noswapfile MyCmd
22  silent MyCmd
23  tab MyCmd
24  topleft MyCmd
25  verbose MyCmd
26  vertical MyCmd
27
28  aboveleft belowright botright browse confirm hide keepalt keepjumps
29	      \ keepmarks keeppatterns lockmarks noswapfile silent tab
30	      \ topleft verbose vertical MyCmd
31
32  call assert_equal(' aboveleft belowright botright browse confirm ' .
33      \ 'hide keepalt keepjumps keepmarks keeppatterns lockmarks ' .
34      \ 'noswapfile silent tab topleft verbose vertical aboveleft ' .
35      \ 'belowright botright browse confirm hide keepalt keepjumps ' .
36      \ 'keepmarks keeppatterns lockmarks noswapfile silent tab topleft ' .
37      \ 'verbose vertical ', g:mods)
38
39  let g:mods = ''
40  command! -nargs=* MyQCmd let g:mods .= '<q-mods> '
41
42  vertical MyQCmd
43  call assert_equal('"vertical" ', g:mods)
44
45  delcommand MyCmd
46  delcommand MyQCmd
47  unlet g:mods
48endfunction
49