Mercurial > vim
annotate src/testdir/test_usercommands.vim @ 24341:0e1b8b98f9f4 v8.2.2711
patch 8.2.2711: "gj" in a closed fold does not move out of the fold
Commit: https://github.com/vim/vim/commit/3c49e74e18993915a779cafe4af3749b39fd3e2a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Apr 4 21:26:04 2021 +0200
patch 8.2.2711: "gj" in a closed fold does not move out of the fold
Problem: "gj" in a closed fold does not move out of the fold. (Marco Hinz)
Solution: Add a check for being in a closed fold. (closes https://github.com/vim/vim/issues/8062)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 04 Apr 2021 21:30:03 +0200 |
parents | 49694eceaa55 |
children | 8d816c266ceb |
rev | line source |
---|---|
9230
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for user defined commands |
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 " Test for <mods> in user defined commands |
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 function Test_cmdmods() |
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 let g:mods = '' |
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
7 command! -nargs=* MyCmd let g:mods = '<mods>' |
9230
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 |
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
10 call assert_equal('', g:mods) |
9230
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 aboveleft MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
12 call assert_equal('aboveleft', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
13 abo MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
14 call assert_equal('aboveleft', g:mods) |
9230
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 belowright MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
16 call assert_equal('belowright', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
17 bel MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
18 call assert_equal('belowright', g:mods) |
9230
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 botright MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
20 call assert_equal('botright', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
21 bo MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
22 call assert_equal('botright', g:mods) |
9230
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 browse MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
24 call assert_equal('browse', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
25 bro MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
26 call assert_equal('browse', g:mods) |
9230
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 confirm MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
28 call assert_equal('confirm', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
29 conf MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
30 call assert_equal('confirm', g:mods) |
9230
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 hide MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
32 call assert_equal('hide', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
33 hid MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
34 call assert_equal('hide', g:mods) |
9230
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 keepalt MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
36 call assert_equal('keepalt', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
37 keepa MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
38 call assert_equal('keepalt', g:mods) |
9230
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 keepjumps MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
40 call assert_equal('keepjumps', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
41 keepj MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
42 call assert_equal('keepjumps', g:mods) |
9230
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 keepmarks MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
44 call assert_equal('keepmarks', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
45 kee MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
46 call assert_equal('keepmarks', g:mods) |
9230
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
47 keeppatterns MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
48 call assert_equal('keeppatterns', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
49 keepp MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
50 call assert_equal('keeppatterns', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
51 leftabove MyCmd " results in :aboveleft |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
52 call assert_equal('aboveleft', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
53 lefta MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
54 call assert_equal('aboveleft', g:mods) |
9230
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
55 lockmarks MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
56 call assert_equal('lockmarks', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
57 loc MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
58 call assert_equal('lockmarks', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
59 " noautocmd MyCmd |
9230
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
60 noswapfile MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
61 call assert_equal('noswapfile', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
62 nos MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
63 call assert_equal('noswapfile', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
64 rightbelow MyCmd " results in :belowright |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
65 call assert_equal('belowright', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
66 rightb MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
67 call assert_equal('belowright', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
68 " sandbox MyCmd |
9230
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
69 silent MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
70 call assert_equal('silent', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
71 sil MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
72 call assert_equal('silent', g:mods) |
9230
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
73 tab MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
74 call assert_equal('tab', g:mods) |
9230
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
75 topleft MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
76 call assert_equal('topleft', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
77 to MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
78 call assert_equal('topleft', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
79 " unsilent MyCmd |
9230
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
80 verbose MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
81 call assert_equal('verbose', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
82 verb MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
83 call assert_equal('verbose', g:mods) |
9230
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
84 vertical MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
85 call assert_equal('vertical', g:mods) |
9703
1f33aece8e55
commit https://github.com/vim/vim/commit/3bcfca3ab4db415d0e750e00204dd25a91fcee77
Christian Brabandt <cb@256bit.org>
parents:
9667
diff
changeset
|
86 vert MyCmd |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
87 call assert_equal('vertical', g:mods) |
9230
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
88 |
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
89 aboveleft belowright botright browse confirm hide keepalt keepjumps |
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
90 \ keepmarks keeppatterns lockmarks noswapfile silent tab |
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
91 \ topleft verbose vertical MyCmd |
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
92 |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
93 call assert_equal('browse confirm hide keepalt keepjumps ' . |
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
94 \ 'keepmarks keeppatterns lockmarks noswapfile silent ' . |
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
95 \ 'verbose aboveleft belowright botright tab topleft vertical', g:mods) |
9230
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
96 |
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
97 let g:mods = '' |
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
98 command! -nargs=* MyQCmd let g:mods .= '<q-mods> ' |
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
99 |
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
100 vertical MyQCmd |
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
101 call assert_equal('"vertical" ', g:mods) |
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
102 |
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
103 delcommand MyCmd |
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
104 delcommand MyQCmd |
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
105 unlet g:mods |
f7fb117883ba
commit https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
106 endfunction |
9667
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
107 |
16413
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
108 func SaveCmdArgs(...) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
109 let g:args = a:000 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
110 endfunc |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
111 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
112 func Test_f_args() |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
113 command -nargs=* TestFArgs call SaveCmdArgs(<f-args>) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
114 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
115 TestFArgs |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
116 call assert_equal([], g:args) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
117 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
118 TestFArgs one two three |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
119 call assert_equal(['one', 'two', 'three'], g:args) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
120 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
121 TestFArgs one\\two three |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
122 call assert_equal(['one\two', 'three'], g:args) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
123 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
124 TestFArgs one\ two three |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
125 call assert_equal(['one two', 'three'], g:args) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
126 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
127 TestFArgs one\"two three |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
128 call assert_equal(['one\"two', 'three'], g:args) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
129 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
130 delcommand TestFArgs |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
131 endfunc |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
132 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
133 func Test_q_args() |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
134 command -nargs=* TestQArgs call SaveCmdArgs(<q-args>) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
135 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
136 TestQArgs |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
137 call assert_equal([''], g:args) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
138 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
139 TestQArgs one two three |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
140 call assert_equal(['one two three'], g:args) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
141 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
142 TestQArgs one\\two three |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
143 call assert_equal(['one\\two three'], g:args) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
144 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
145 TestQArgs one\ two three |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
146 call assert_equal(['one\ two three'], g:args) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
147 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
148 TestQArgs one\"two three |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
149 call assert_equal(['one\"two three'], g:args) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
150 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
151 delcommand TestQArgs |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
152 endfunc |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
153 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
154 func Test_reg_arg() |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
155 command -nargs=* -reg TestRegArg call SaveCmdArgs("<reg>", "<register>") |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
156 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
157 TestRegArg |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
158 call assert_equal(['', ''], g:args) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
159 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
160 TestRegArg x |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
161 call assert_equal(['x', 'x'], g:args) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
162 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
163 delcommand TestRegArg |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
164 endfunc |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
165 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
166 func Test_no_arg() |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
167 command -nargs=* TestNoArg call SaveCmdArgs("<args>", "<>", "<x>", "<lt>") |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
168 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
169 TestNoArg |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
170 call assert_equal(['', '<>', '<x>', '<'], g:args) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
171 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
172 TestNoArg one |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
173 call assert_equal(['one', '<>', '<x>', '<'], g:args) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
174 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
175 delcommand TestNoArg |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
176 endfunc |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
177 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
178 func Test_range_arg() |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
179 command -range TestRangeArg call SaveCmdArgs(<range>, <line1>, <line2>) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
180 new |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
181 call setline(1, range(100)) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
182 let lnum = line('.') |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
183 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
184 TestRangeArg |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
185 call assert_equal([0, lnum, lnum], g:args) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
186 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
187 99TestRangeArg |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
188 call assert_equal([1, 99, 99], g:args) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
189 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
190 88,99TestRangeArg |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
191 call assert_equal([2, 88, 99], g:args) |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
192 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
193 call assert_fails('102TestRangeArg', 'E16:') |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
194 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
195 bwipe! |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
196 delcommand TestRangeArg |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
197 endfunc |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
198 |
9667
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
199 func Test_Ambiguous() |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
200 command Doit let g:didit = 'yes' |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
201 command Dothat let g:didthat = 'also' |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
202 call assert_fails('Do', 'E464:') |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
203 Doit |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
204 call assert_equal('yes', g:didit) |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
205 Dothat |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
206 call assert_equal('also', g:didthat) |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
207 unlet g:didit |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
208 unlet g:didthat |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
209 |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
210 delcommand Doit |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
211 Do |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
212 call assert_equal('also', g:didthat) |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
213 delcommand Dothat |
16413
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
214 |
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
215 call assert_fails("\x4ei\041", ' you demand a ') |
9667
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
216 endfunc |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
217 |
15125
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
218 func Test_redefine_on_reload() |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
219 call writefile(['command ExistingCommand echo "yes"'], 'Xcommandexists') |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
220 call assert_equal(0, exists(':ExistingCommand')) |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
221 source Xcommandexists |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
222 call assert_equal(2, exists(':ExistingCommand')) |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
223 " Redefining a command when reloading a script is OK. |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
224 source Xcommandexists |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
225 call assert_equal(2, exists(':ExistingCommand')) |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
226 |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
227 " But redefining in another script is not OK. |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
228 call writefile(['command ExistingCommand echo "yes"'], 'Xcommandexists2') |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
229 call assert_fails('source Xcommandexists2', 'E174:') |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
230 call delete('Xcommandexists2') |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
231 |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
232 " And defining twice in one script is not OK. |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
233 delcommand ExistingCommand |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
234 call assert_equal(0, exists(':ExistingCommand')) |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
235 call writefile([ |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
236 \ 'command ExistingCommand echo "yes"', |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
237 \ 'command ExistingCommand echo "no"', |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
238 \ ], 'Xcommandexists') |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
239 call assert_fails('source Xcommandexists', 'E174:') |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
240 call assert_equal(2, exists(':ExistingCommand')) |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
241 |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
242 call delete('Xcommandexists') |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
243 delcommand ExistingCommand |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
244 endfunc |
b101b193d5ff
patch 8.1.0573: cannot redefine user command without ! in same script
Bram Moolenaar <Bram@vim.org>
parents:
15099
diff
changeset
|
245 |
9667
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
246 func Test_CmdUndefined() |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
247 call assert_fails('Doit', 'E492:') |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
248 au CmdUndefined Doit :command Doit let g:didit = 'yes' |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
249 Doit |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
250 call assert_equal('yes', g:didit) |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
251 delcommand Doit |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
252 |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
253 call assert_fails('Dothat', 'E492:') |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
254 au CmdUndefined * let g:didnot = 'yes' |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
255 call assert_fails('Dothat', 'E492:') |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
256 call assert_equal('yes', g:didnot) |
c27052511998
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Christian Brabandt <cb@256bit.org>
parents:
9230
diff
changeset
|
257 endfunc |
10704
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
258 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
259 func Test_CmdErrors() |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
260 call assert_fails('com! docmd :', 'E183:') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
261 call assert_fails('com! \<Tab> :', 'E182:') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
262 call assert_fails('com! _ :', 'E182:') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
263 call assert_fails('com! X :', 'E841:') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
264 call assert_fails('com! - DoCmd :', 'E175:') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
265 call assert_fails('com! -xxx DoCmd :', 'E181:') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
266 call assert_fails('com! -addr DoCmd :', 'E179:') |
16413
4734d601ebdd
patch 8.1.1211: not all user command code is tested
Bram Moolenaar <Bram@vim.org>
parents:
16403
diff
changeset
|
267 call assert_fails('com! -addr=asdf DoCmd :', 'E180:') |
10704
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
268 call assert_fails('com! -complete DoCmd :', 'E179:') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
269 call assert_fails('com! -complete=xxx DoCmd :', 'E180:') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
270 call assert_fails('com! -complete=custom DoCmd :', 'E467:') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
271 call assert_fails('com! -complete=customlist DoCmd :', 'E467:') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
272 call assert_fails('com! -complete=behave,CustomComplete DoCmd :', 'E468:') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
273 call assert_fails('com! -nargs=x DoCmd :', 'E176:') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
274 call assert_fails('com! -count=1 -count=2 DoCmd :', 'E177:') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
275 call assert_fails('com! -count=x DoCmd :', 'E178:') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
276 call assert_fails('com! -range=x DoCmd :', 'E178:') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
277 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
278 com! -nargs=0 DoCmd : |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
279 call assert_fails('DoCmd x', 'E488:') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
280 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
281 com! -nargs=1 DoCmd : |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
282 call assert_fails('DoCmd', 'E471:') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
283 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
284 com! -nargs=+ DoCmd : |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
285 call assert_fails('DoCmd', 'E471:') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
286 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
287 call assert_fails('com DoCmd :', 'E174:') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
288 comclear |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
289 call assert_fails('delcom DoCmd', 'E184:') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
290 endfunc |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
291 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
292 func CustomComplete(A, L, P) |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
293 return "January\nFebruary\nMars\n" |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
294 endfunc |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
295 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
296 func CustomCompleteList(A, L, P) |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
16475
diff
changeset
|
297 return [ "Monday", "Tuesday", "Wednesday", {}] |
10704
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
298 endfunc |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
299 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
300 func Test_CmdCompletion() |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
301 call feedkeys(":com -\<C-A>\<C-B>\"\<CR>", 'tx') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
302 call assert_equal('"com -addr bang bar buffer complete count nargs range register', @:) |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
303 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
304 call feedkeys(":com -nargs=0 -\<C-A>\<C-B>\"\<CR>", 'tx') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
305 call assert_equal('"com -nargs=0 -addr bang bar buffer complete count nargs range register', @:) |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
306 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
307 call feedkeys(":com -nargs=\<C-A>\<C-B>\"\<CR>", 'tx') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
308 call assert_equal('"com -nargs=* + 0 1 ?', @:) |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
309 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
310 call feedkeys(":com -addr=\<C-A>\<C-B>\"\<CR>", 'tx') |
15099
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
311 call assert_equal('"com -addr=arguments buffers lines loaded_buffers other quickfix tabs windows', @:) |
10704
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
312 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
313 call feedkeys(":com -complete=co\<C-A>\<C-B>\"\<CR>", 'tx') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
314 call assert_equal('"com -complete=color command compiler', @:) |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
315 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
316 command! DoCmd1 : |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
317 command! DoCmd2 : |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
318 call feedkeys(":com \<C-A>\<C-B>\"\<CR>", 'tx') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
319 call assert_equal('"com DoCmd1 DoCmd2', @:) |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
320 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
321 call feedkeys(":DoC\<C-A>\<C-B>\"\<CR>", 'tx') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
322 call assert_equal('"DoCmd1 DoCmd2', @:) |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
323 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
324 call feedkeys(":delcom DoC\<C-A>\<C-B>\"\<CR>", 'tx') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
325 call assert_equal('"delcom DoCmd1 DoCmd2', @:) |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
326 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
327 delcom DoCmd1 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
328 call feedkeys(":delcom DoC\<C-A>\<C-B>\"\<CR>", 'tx') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
329 call assert_equal('"delcom DoCmd2', @:) |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
330 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
331 call feedkeys(":com DoC\<C-A>\<C-B>\"\<CR>", 'tx') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
332 call assert_equal('"com DoCmd2', @:) |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
333 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
334 delcom DoCmd2 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
335 call feedkeys(":delcom DoC\<C-A>\<C-B>\"\<CR>", 'tx') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
336 call assert_equal('"delcom DoC', @:) |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
337 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
338 call feedkeys(":com DoC\<C-A>\<C-B>\"\<CR>", 'tx') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
339 call assert_equal('"com DoC', @:) |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
340 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
341 com! -complete=behave DoCmd : |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
342 call feedkeys(":DoCmd \<C-A>\<C-B>\"\<CR>", 'tx') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
343 call assert_equal('"DoCmd mswin xterm', @:) |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
344 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
345 " This does not work. Why? |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
346 "call feedkeys(":DoCmd x\<C-A>\<C-B>\"\<CR>", 'tx') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
347 "call assert_equal('"DoCmd xterm', @:) |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
348 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
349 com! -complete=custom,CustomComplete DoCmd : |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
350 call feedkeys(":DoCmd \<C-A>\<C-B>\"\<CR>", 'tx') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
351 call assert_equal('"DoCmd January February Mars', @:) |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
352 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
353 com! -complete=customlist,CustomCompleteList DoCmd : |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
354 call feedkeys(":DoCmd \<C-A>\<C-B>\"\<CR>", 'tx') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
355 call assert_equal('"DoCmd Monday Tuesday Wednesday', @:) |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
356 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
357 com! -complete=custom,CustomCompleteList DoCmd : |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
358 call assert_fails("call feedkeys(':DoCmd \<C-D>', 'tx')", 'E730:') |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
359 |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
360 com! -complete=customlist,CustomComp DoCmd : |
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
361 call assert_fails("call feedkeys(':DoCmd \<C-D>', 'tx')", 'E117:') |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
16475
diff
changeset
|
362 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
16475
diff
changeset
|
363 " custom completion without a function |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
16475
diff
changeset
|
364 com! -complete=custom, DoCmd |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
16475
diff
changeset
|
365 call assert_beeps("call feedkeys(':DoCmd \t', 'tx')") |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
16475
diff
changeset
|
366 |
20156
49694eceaa55
patch 8.2.0633: crash when using null partial in filter()
Bram Moolenaar <Bram@vim.org>
parents:
20128
diff
changeset
|
367 " custom completion failure with the wrong function |
49694eceaa55
patch 8.2.0633: crash when using null partial in filter()
Bram Moolenaar <Bram@vim.org>
parents:
20128
diff
changeset
|
368 com! -complete=custom,min DoCmd |
49694eceaa55
patch 8.2.0633: crash when using null partial in filter()
Bram Moolenaar <Bram@vim.org>
parents:
20128
diff
changeset
|
369 call assert_fails("call feedkeys(':DoCmd \t', 'tx')", 'E118:') |
49694eceaa55
patch 8.2.0633: crash when using null partial in filter()
Bram Moolenaar <Bram@vim.org>
parents:
20128
diff
changeset
|
370 |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
16475
diff
changeset
|
371 delcom DoCmd |
10704
6736cb425720
patch 8.0.0242: no tests for user command completion
Christian Brabandt <cb@256bit.org>
parents:
9703
diff
changeset
|
372 endfunc |
13101
9b3f8029a326
patch 8.0.1425: execute() does not work in completion of user command
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
373 |
9b3f8029a326
patch 8.0.1425: execute() does not work in completion of user command
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
374 func CallExecute(A, L, P) |
9b3f8029a326
patch 8.0.1425: execute() does not work in completion of user command
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
375 " Drop first '\n' |
9b3f8029a326
patch 8.0.1425: execute() does not work in completion of user command
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
376 return execute('echo "hi"')[1:] |
9b3f8029a326
patch 8.0.1425: execute() does not work in completion of user command
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
377 endfunc |
9b3f8029a326
patch 8.0.1425: execute() does not work in completion of user command
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
378 |
9b3f8029a326
patch 8.0.1425: execute() does not work in completion of user command
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
379 func Test_use_execute_in_completion() |
9b3f8029a326
patch 8.0.1425: execute() does not work in completion of user command
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
380 command! -nargs=* -complete=custom,CallExecute DoExec : |
9b3f8029a326
patch 8.0.1425: execute() does not work in completion of user command
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
381 call feedkeys(":DoExec \<C-A>\<C-B>\"\<CR>", 'tx') |
9b3f8029a326
patch 8.0.1425: execute() does not work in completion of user command
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
382 call assert_equal('"DoExec hi', @:) |
9b3f8029a326
patch 8.0.1425: execute() does not work in completion of user command
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
383 delcommand DoExec |
9b3f8029a326
patch 8.0.1425: execute() does not work in completion of user command
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
384 endfunc |
15099
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
385 |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
386 func Test_addr_all() |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
387 command! -addr=lines DoSomething let g:a1 = <line1> | let g:a2 = <line2> |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
388 %DoSomething |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
389 call assert_equal(1, g:a1) |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
390 call assert_equal(line('$'), g:a2) |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
391 |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
392 command! -addr=arguments DoSomething let g:a1 = <line1> | let g:a2 = <line2> |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
393 args one two three |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
394 %DoSomething |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
395 call assert_equal(1, g:a1) |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
396 call assert_equal(3, g:a2) |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
397 |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
398 command! -addr=buffers DoSomething let g:a1 = <line1> | let g:a2 = <line2> |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
399 %DoSomething |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
400 for low in range(1, bufnr('$')) |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
401 if buflisted(low) |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
402 break |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
403 endif |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
404 endfor |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
405 call assert_equal(low, g:a1) |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
406 call assert_equal(bufnr('$'), g:a2) |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
407 |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
408 command! -addr=loaded_buffers DoSomething let g:a1 = <line1> | let g:a2 = <line2> |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
409 %DoSomething |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
410 for low in range(1, bufnr('$')) |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
411 if bufloaded(low) |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
412 break |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
413 endif |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
414 endfor |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
415 call assert_equal(low, g:a1) |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
416 for up in range(bufnr('$'), 1, -1) |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
417 if bufloaded(up) |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
418 break |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
419 endif |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
420 endfor |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
421 call assert_equal(up, g:a2) |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
422 |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
423 command! -addr=windows DoSomething let g:a1 = <line1> | let g:a2 = <line2> |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
424 new |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
425 %DoSomething |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
426 call assert_equal(1, g:a1) |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
427 call assert_equal(winnr('$'), g:a2) |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
428 bwipe |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
429 |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
430 command! -addr=tabs DoSomething let g:a1 = <line1> | let g:a2 = <line2> |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
431 tabnew |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
432 %DoSomething |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
433 call assert_equal(1, g:a1) |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
434 call assert_equal(len(gettabinfo()), g:a2) |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
435 bwipe |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
436 |
16475
854fb0ad4be6
patch 8.1.1241: Ex command info contains confusing information
Bram Moolenaar <Bram@vim.org>
parents:
16413
diff
changeset
|
437 command! -addr=other DoSomething let g:a1 = <line1> | let g:a2 = <line2> |
15099
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
438 DoSomething |
16475
854fb0ad4be6
patch 8.1.1241: Ex command info contains confusing information
Bram Moolenaar <Bram@vim.org>
parents:
16413
diff
changeset
|
439 call assert_equal(line('.'), g:a1) |
854fb0ad4be6
patch 8.1.1241: Ex command info contains confusing information
Bram Moolenaar <Bram@vim.org>
parents:
16413
diff
changeset
|
440 call assert_equal(line('.'), g:a2) |
854fb0ad4be6
patch 8.1.1241: Ex command info contains confusing information
Bram Moolenaar <Bram@vim.org>
parents:
16413
diff
changeset
|
441 %DoSomething |
854fb0ad4be6
patch 8.1.1241: Ex command info contains confusing information
Bram Moolenaar <Bram@vim.org>
parents:
16413
diff
changeset
|
442 call assert_equal(1, g:a1) |
854fb0ad4be6
patch 8.1.1241: Ex command info contains confusing information
Bram Moolenaar <Bram@vim.org>
parents:
16413
diff
changeset
|
443 call assert_equal(line('$'), g:a2) |
15099
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
444 |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
445 delcommand DoSomething |
39728d503e47
patch 8.1.0560: cannot use address type "other" with with user command
Bram Moolenaar <Bram@vim.org>
parents:
13101
diff
changeset
|
446 endfunc |
16403
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
447 |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
448 func Test_command_list() |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
449 command! DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
450 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
451 \ .. "\n DoCmd 0 :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
452 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
453 |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
454 " Test with various -range= and -count= argument values. |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
455 command! -range DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
456 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
457 \ .. "\n DoCmd 0 . :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
458 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
459 command! -range=% DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
460 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
461 \ .. "\n DoCmd 0 % :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
462 \ execute('command! DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
463 command! -range=2 DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
464 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
465 \ .. "\n DoCmd 0 2 :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
466 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
467 command! -count=2 DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
468 call assert_equal("\n Name Args Address Complete Definition" |
16475
854fb0ad4be6
patch 8.1.1241: Ex command info contains confusing information
Bram Moolenaar <Bram@vim.org>
parents:
16413
diff
changeset
|
469 \ .. "\n DoCmd 0 2c ? :", |
16403
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
470 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
471 |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
472 " Test with various -addr= argument values. |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
473 command! -addr=lines DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
474 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
475 \ .. "\n DoCmd 0 . :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
476 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
477 command! -addr=arguments DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
478 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
479 \ .. "\n DoCmd 0 . arg :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
480 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
481 command! -addr=buffers DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
482 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
483 \ .. "\n DoCmd 0 . buf :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
484 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
485 command! -addr=loaded_buffers DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
486 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
487 \ .. "\n DoCmd 0 . load :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
488 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
489 command! -addr=windows DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
490 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
491 \ .. "\n DoCmd 0 . win :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
492 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
493 command! -addr=tabs DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
494 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
495 \ .. "\n DoCmd 0 . tab :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
496 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
497 command! -addr=other DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
498 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
499 \ .. "\n DoCmd 0 . ? :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
500 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
501 |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
502 " Test with various -complete= argument values (non-exhaustive list) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
503 command! -complete=arglist DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
504 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
505 \ .. "\n DoCmd 0 arglist :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
506 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
507 command! -complete=augroup DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
508 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
509 \ .. "\n DoCmd 0 augroup :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
510 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
511 command! -complete=custom,CustomComplete DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
512 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
513 \ .. "\n DoCmd 0 custom :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
514 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
515 command! -complete=customlist,CustomComplete DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
516 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
517 \ .. "\n DoCmd 0 customlist :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
518 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
519 |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
520 " Test with various -narg= argument values. |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
521 command! -nargs=0 DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
522 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
523 \ .. "\n DoCmd 0 :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
524 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
525 command! -nargs=1 DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
526 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
527 \ .. "\n DoCmd 1 :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
528 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
529 command! -nargs=* DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
530 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
531 \ .. "\n DoCmd * :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
532 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
533 command! -nargs=? DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
534 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
535 \ .. "\n DoCmd ? :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
536 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
537 command! -nargs=+ DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
538 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
539 \ .. "\n DoCmd + :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
540 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
541 |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
542 " Test with other arguments. |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
543 command! -bang DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
544 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
545 \ .. "\n! DoCmd 0 :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
546 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
547 command! -bar DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
548 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
549 \ .. "\n| DoCmd 0 :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
550 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
551 command! -register DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
552 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
553 \ .. "\n\" DoCmd 0 :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
554 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
555 command! -buffer DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
556 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
557 \ .. "\nb DoCmd 0 :" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
558 \ .. "\n\" DoCmd 0 :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
559 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
560 comclear |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
561 |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
562 " Test with many args. |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
563 command! -bang -bar -register -buffer -nargs=+ -complete=environment -addr=windows -count=3 DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
564 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
565 \ .. "\n!\"b|DoCmd + 3c win environment :", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
566 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
567 comclear |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
568 |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
569 " Test with special characters in command definition. |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
570 command! DoCmd :<cr><tab><c-d> |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
571 call assert_equal("\n Name Args Address Complete Definition" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
572 \ .. "\n DoCmd 0 :<CR><Tab><C-D>", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
573 \ execute('command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
574 |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
575 " Test output in verbose mode. |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
576 command! DoCmd : |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
577 call assert_match("^\n" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
578 \ .. " Name Args Address Complete Definition\n" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
579 \ .. " DoCmd 0 :\n" |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
580 \ .. "\tLast set from .*/test_usercommands.vim line \\d\\+$", |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
581 \ execute('verbose command DoCmd')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
582 |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
583 comclear |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
584 call assert_equal("\nNo user-defined commands found", execute(':command Xxx')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
585 call assert_equal("\nNo user-defined commands found", execute('command')) |
250420b35b10
patch 8.1.1206: user command parsing and listing not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
15125
diff
changeset
|
586 endfunc |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
16475
diff
changeset
|
587 |
19724
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
588 " Test for a custom user completion returning the wrong value type |
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
589 func Test_usercmd_custom() |
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
590 func T1(a, c, p) |
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
591 return "a\nb\n" |
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
592 endfunc |
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
593 command -nargs=* -complete=customlist,T1 TCmd1 |
20128
0b35a7ffceb2
patch 8.2.0619: null dict is not handled like an empty dict
Bram Moolenaar <Bram@vim.org>
parents:
20043
diff
changeset
|
594 call feedkeys(":TCmd1 \<C-A>\<C-B>\"\<CR>", 'xt') |
0b35a7ffceb2
patch 8.2.0619: null dict is not handled like an empty dict
Bram Moolenaar <Bram@vim.org>
parents:
20043
diff
changeset
|
595 call assert_equal('"TCmd1 ', @:) |
19724
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
596 delcommand TCmd1 |
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
597 delfunc T1 |
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
598 |
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
599 func T2(a, c, p) |
20128
0b35a7ffceb2
patch 8.2.0619: null dict is not handled like an empty dict
Bram Moolenaar <Bram@vim.org>
parents:
20043
diff
changeset
|
600 return {} |
19724
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
601 endfunc |
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
602 command -nargs=* -complete=customlist,T2 TCmd2 |
20128
0b35a7ffceb2
patch 8.2.0619: null dict is not handled like an empty dict
Bram Moolenaar <Bram@vim.org>
parents:
20043
diff
changeset
|
603 call feedkeys(":TCmd2 \<C-A>\<C-B>\"\<CR>", 'xt') |
0b35a7ffceb2
patch 8.2.0619: null dict is not handled like an empty dict
Bram Moolenaar <Bram@vim.org>
parents:
20043
diff
changeset
|
604 call assert_equal('"TCmd2 ', @:) |
19724
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
605 delcommand TCmd2 |
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
606 delfunc T2 |
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
607 endfunc |
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
608 |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
16475
diff
changeset
|
609 " vim: shiftwidth=2 sts=2 expandtab |