Mercurial > vim
annotate src/testdir/test_cmdline.vim @ 12944:2d54f1e7ba0f v8.0.1348
patch 8.0.1348: make testclean deletes script file on MS-Windows
commit https://github.com/vim/vim/commit/c8c75796a60e89210cc470f1b3864546fd4f319a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Nov 26 17:18:06 2017 +0100
patch 8.0.1348: make testclean deletes script file on MS-Windows
Problem: Make testclean deletes script file on MS-Windows.
Solution: Rename file to avoid it starting with an "x".
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 26 Nov 2017 17:30:05 +0100 |
parents | 9b882316aa63 |
children | 1fd0f8392946 |
rev | line source |
---|---|
9280
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for editing the command line. |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
11091
ae45d497868f
patch 8.0.0433: beeps when running tests
Christian Brabandt <cb@256bit.org>
parents:
11026
diff
changeset
|
3 |
9280
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 func Test_complete_tab() |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 call writefile(['testfile'], 'Xtestfile') |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 call feedkeys(":e Xtest\t\r", "tx") |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 call assert_equal('testfile', getline(1)) |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 call delete('Xtestfile') |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 endfunc |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 func Test_complete_list() |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 " We can't see the output, but at least we check the code runs properly. |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 call feedkeys(":e test\<C-D>\r", "tx") |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 call assert_equal('test', expand('%:t')) |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 endfunc |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 func Test_complete_wildmenu() |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 call writefile(['testfile1'], 'Xtestfile1') |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 call writefile(['testfile2'], 'Xtestfile2') |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 set wildmenu |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 call feedkeys(":e Xtest\t\t\r", "tx") |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 call assert_equal('testfile2', getline(1)) |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 call delete('Xtestfile1') |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 call delete('Xtestfile2') |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 set nowildmenu |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 endfunc |
9460
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
28 |
11026
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
29 func Test_map_completion() |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
30 if !has('cmdline_compl') |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
31 return |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
32 endif |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
33 call feedkeys(":map <unique> <si\<Tab>\<Home>\"\<CR>", 'xt') |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
34 call assert_equal('"map <unique> <silent>', getreg(':')) |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
35 call feedkeys(":map <script> <un\<Tab>\<Home>\"\<CR>", 'xt') |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
36 call assert_equal('"map <script> <unique>', getreg(':')) |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
37 call feedkeys(":map <expr> <sc\<Tab>\<Home>\"\<CR>", 'xt') |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
38 call assert_equal('"map <expr> <script>', getreg(':')) |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
39 call feedkeys(":map <buffer> <e\<Tab>\<Home>\"\<CR>", 'xt') |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
40 call assert_equal('"map <buffer> <expr>', getreg(':')) |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
41 call feedkeys(":map <nowait> <b\<Tab>\<Home>\"\<CR>", 'xt') |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
42 call assert_equal('"map <nowait> <buffer>', getreg(':')) |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
43 call feedkeys(":map <special> <no\<Tab>\<Home>\"\<CR>", 'xt') |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
44 call assert_equal('"map <special> <nowait>', getreg(':')) |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
45 call feedkeys(":map <silent> <sp\<Tab>\<Home>\"\<CR>", 'xt') |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
46 call assert_equal('"map <silent> <special>', getreg(':')) |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
47 endfunc |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
48 |
10660
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
49 func Test_match_completion() |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
50 if !has('cmdline_compl') |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
51 return |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
52 endif |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
53 hi Aardig ctermfg=green |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
54 call feedkeys(":match \<Tab>\<Home>\"\<CR>", 'xt') |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
55 call assert_equal('"match Aardig', getreg(':')) |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
56 call feedkeys(":match \<S-Tab>\<Home>\"\<CR>", 'xt') |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
57 call assert_equal('"match none', getreg(':')) |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
58 endfunc |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
59 |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
60 func Test_highlight_completion() |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
61 if !has('cmdline_compl') |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
62 return |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
63 endif |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
64 hi Aardig ctermfg=green |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
65 call feedkeys(":hi \<Tab>\<Home>\"\<CR>", 'xt') |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
66 call assert_equal('"hi Aardig', getreg(':')) |
11354
129077fb57e6
patch 8.0.0562: not enough test coverage for syntax commands
Christian Brabandt <cb@256bit.org>
parents:
11323
diff
changeset
|
67 call feedkeys(":hi default \<Tab>\<Home>\"\<CR>", 'xt') |
129077fb57e6
patch 8.0.0562: not enough test coverage for syntax commands
Christian Brabandt <cb@256bit.org>
parents:
11323
diff
changeset
|
68 call assert_equal('"hi default Aardig', getreg(':')) |
129077fb57e6
patch 8.0.0562: not enough test coverage for syntax commands
Christian Brabandt <cb@256bit.org>
parents:
11323
diff
changeset
|
69 call feedkeys(":hi clear Aa\<Tab>\<Home>\"\<CR>", 'xt') |
129077fb57e6
patch 8.0.0562: not enough test coverage for syntax commands
Christian Brabandt <cb@256bit.org>
parents:
11323
diff
changeset
|
70 call assert_equal('"hi clear Aardig', getreg(':')) |
10660
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
71 call feedkeys(":hi li\<S-Tab>\<Home>\"\<CR>", 'xt') |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
72 call assert_equal('"hi link', getreg(':')) |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
73 call feedkeys(":hi d\<S-Tab>\<Home>\"\<CR>", 'xt') |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
74 call assert_equal('"hi default', getreg(':')) |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
75 call feedkeys(":hi c\<S-Tab>\<Home>\"\<CR>", 'xt') |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
76 call assert_equal('"hi clear', getreg(':')) |
11254
918942a3b0ef
patch 8.0.0513: getting name of cleared highlight group is wrong
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
77 |
918942a3b0ef
patch 8.0.0513: getting name of cleared highlight group is wrong
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
78 " A cleared group does not show up in completions. |
918942a3b0ef
patch 8.0.0513: getting name of cleared highlight group is wrong
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
79 hi Anders ctermfg=green |
918942a3b0ef
patch 8.0.0513: getting name of cleared highlight group is wrong
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
80 call assert_equal(['Aardig', 'Anders'], getcompletion('A', 'highlight')) |
918942a3b0ef
patch 8.0.0513: getting name of cleared highlight group is wrong
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
81 hi clear Aardig |
918942a3b0ef
patch 8.0.0513: getting name of cleared highlight group is wrong
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
82 call assert_equal(['Anders'], getcompletion('A', 'highlight')) |
918942a3b0ef
patch 8.0.0513: getting name of cleared highlight group is wrong
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
83 hi clear Anders |
918942a3b0ef
patch 8.0.0513: getting name of cleared highlight group is wrong
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
84 call assert_equal([], getcompletion('A', 'highlight')) |
10660
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
85 endfunc |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
86 |
10656
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
87 func Test_expr_completion() |
10660
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
88 if !has('cmdline_compl') |
10656
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
89 return |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
90 endif |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
91 for cmd in [ |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
92 \ 'let a = ', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
93 \ 'if', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
94 \ 'elseif', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
95 \ 'while', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
96 \ 'for', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
97 \ 'echo', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
98 \ 'echon', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
99 \ 'execute', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
100 \ 'echomsg', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
101 \ 'echoerr', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
102 \ 'call', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
103 \ 'return', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
104 \ 'cexpr', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
105 \ 'caddexpr', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
106 \ 'cgetexpr', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
107 \ 'lexpr', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
108 \ 'laddexpr', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
109 \ 'lgetexpr'] |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
110 call feedkeys(":" . cmd . " getl\<Tab>\<Home>\"\<CR>", 'xt') |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
111 call assert_equal('"' . cmd . ' getline(', getreg(':')) |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
112 endfor |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
113 endfunc |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
114 |
9460
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
115 func Test_getcompletion() |
9462
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
116 if !has('cmdline_compl') |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
117 return |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
118 endif |
9460
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
119 let groupcount = len(getcompletion('', 'event')) |
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
120 call assert_true(groupcount > 0) |
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
121 let matchcount = len(getcompletion('File', 'event')) |
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
122 call assert_true(matchcount > 0) |
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
123 call assert_true(groupcount > matchcount) |
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
124 |
9462
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
125 if has('menu') |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
126 source $VIMRUNTIME/menu.vim |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
127 let matchcount = len(getcompletion('', 'menu')) |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
128 call assert_true(matchcount > 0) |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
129 call assert_equal(['File.'], getcompletion('File', 'menu')) |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
130 call assert_true(matchcount > 0) |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
131 let matchcount = len(getcompletion('File.', 'menu')) |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
132 call assert_true(matchcount > 0) |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
133 endif |
9460
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
134 |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
135 let l = getcompletion('v:n', 'var') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
136 call assert_true(index(l, 'v:null') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
137 let l = getcompletion('v:notexists', 'var') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
138 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
139 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
140 let l = getcompletion('', 'augroup') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
141 call assert_true(index(l, 'END') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
142 let l = getcompletion('blahblah', 'augroup') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
143 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
144 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
145 let l = getcompletion('', 'behave') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
146 call assert_true(index(l, 'mswin') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
147 let l = getcompletion('not', 'behave') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
148 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
149 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
150 let l = getcompletion('', 'color') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
151 call assert_true(index(l, 'default') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
152 let l = getcompletion('dirty', 'color') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
153 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
154 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
155 let l = getcompletion('', 'command') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
156 call assert_true(index(l, 'sleep') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
157 let l = getcompletion('awake', 'command') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
158 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
159 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
160 let l = getcompletion('', 'dir') |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
161 call assert_true(index(l, 'samples/') >= 0) |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
162 let l = getcompletion('NoMatch', 'dir') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
163 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
164 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
165 let l = getcompletion('exe', 'expression') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
166 call assert_true(index(l, 'executable(') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
167 let l = getcompletion('kill', 'expression') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
168 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
169 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
170 let l = getcompletion('tag', 'function') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
171 call assert_true(index(l, 'taglist(') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
172 let l = getcompletion('paint', 'function') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
173 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
174 |
9638
af0d98d8836e
commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038
Christian Brabandt <cb@256bit.org>
parents:
9577
diff
changeset
|
175 let Flambda = {-> 'hello'} |
af0d98d8836e
commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038
Christian Brabandt <cb@256bit.org>
parents:
9577
diff
changeset
|
176 let l = getcompletion('', 'function') |
af0d98d8836e
commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038
Christian Brabandt <cb@256bit.org>
parents:
9577
diff
changeset
|
177 let l = filter(l, {i, v -> v =~ 'lambda'}) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
178 call assert_equal([], l) |
9638
af0d98d8836e
commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038
Christian Brabandt <cb@256bit.org>
parents:
9577
diff
changeset
|
179 |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
180 let l = getcompletion('run', 'file') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
181 call assert_true(index(l, 'runtest.vim') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
182 let l = getcompletion('walk', 'file') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
183 call assert_equal([], l) |
9861
74f67cb4f7e1
commit https://github.com/vim/vim/commit/e9d58a6459687a1228b5aa85bd7b31f8f1e528a8
Christian Brabandt <cb@256bit.org>
parents:
9774
diff
changeset
|
184 set wildignore=*.vim |
74f67cb4f7e1
commit https://github.com/vim/vim/commit/e9d58a6459687a1228b5aa85bd7b31f8f1e528a8
Christian Brabandt <cb@256bit.org>
parents:
9774
diff
changeset
|
185 let l = getcompletion('run', 'file', 1) |
74f67cb4f7e1
commit https://github.com/vim/vim/commit/e9d58a6459687a1228b5aa85bd7b31f8f1e528a8
Christian Brabandt <cb@256bit.org>
parents:
9774
diff
changeset
|
186 call assert_true(index(l, 'runtest.vim') < 0) |
74f67cb4f7e1
commit https://github.com/vim/vim/commit/e9d58a6459687a1228b5aa85bd7b31f8f1e528a8
Christian Brabandt <cb@256bit.org>
parents:
9774
diff
changeset
|
187 set wildignore& |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
188 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
189 let l = getcompletion('ha', 'filetype') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
190 call assert_true(index(l, 'hamster') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
191 let l = getcompletion('horse', 'filetype') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
192 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
193 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
194 let l = getcompletion('z', 'syntax') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
195 call assert_true(index(l, 'zimbu') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
196 let l = getcompletion('emacs', 'syntax') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
197 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
198 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
199 let l = getcompletion('jikes', 'compiler') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
200 call assert_true(index(l, 'jikes') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
201 let l = getcompletion('break', 'compiler') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
202 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
203 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
204 let l = getcompletion('last', 'help') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
205 call assert_true(index(l, ':tablast') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
206 let l = getcompletion('giveup', 'help') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
207 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
208 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
209 let l = getcompletion('time', 'option') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
210 call assert_true(index(l, 'timeoutlen') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
211 let l = getcompletion('space', 'option') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
212 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
213 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
214 let l = getcompletion('er', 'highlight') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
215 call assert_true(index(l, 'ErrorMsg') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
216 let l = getcompletion('dark', 'highlight') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
217 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
218 |
10275
6d8b2da002e9
commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents:
10007
diff
changeset
|
219 let l = getcompletion('', 'messages') |
6d8b2da002e9
commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents:
10007
diff
changeset
|
220 call assert_true(index(l, 'clear') >= 0) |
6d8b2da002e9
commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents:
10007
diff
changeset
|
221 let l = getcompletion('not', 'messages') |
6d8b2da002e9
commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents:
10007
diff
changeset
|
222 call assert_equal([], l) |
6d8b2da002e9
commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents:
10007
diff
changeset
|
223 |
11995
7df3dd3c0ac1
patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents:
11354
diff
changeset
|
224 let l = getcompletion('', 'mapclear') |
7df3dd3c0ac1
patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents:
11354
diff
changeset
|
225 call assert_true(index(l, '<buffer>') >= 0) |
7df3dd3c0ac1
patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents:
11354
diff
changeset
|
226 let l = getcompletion('not', 'mapclear') |
7df3dd3c0ac1
patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents:
11354
diff
changeset
|
227 call assert_equal([], l) |
7df3dd3c0ac1
patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents:
11354
diff
changeset
|
228 |
9766
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
229 if has('cscope') |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
230 let l = getcompletion('', 'cscope') |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
231 let cmds = ['add', 'find', 'help', 'kill', 'reset', 'show'] |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
232 call assert_equal(cmds, l) |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
233 " using cmdline completion must not change the result |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
234 call feedkeys(":cscope find \<c-d>\<c-c>", 'xt') |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
235 let l = getcompletion('', 'cscope') |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
236 call assert_equal(cmds, l) |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
237 let keys = ['a', 'c', 'd', 'e', 'f', 'g', 'i', 's', 't'] |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
238 let l = getcompletion('find ', 'cscope') |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
239 call assert_equal(keys, l) |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
240 endif |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
241 |
9774
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
242 if has('signs') |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
243 sign define Testing linehl=Comment |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
244 let l = getcompletion('', 'sign') |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
245 let cmds = ['define', 'jump', 'list', 'place', 'undefine', 'unplace'] |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
246 call assert_equal(cmds, l) |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
247 " using cmdline completion must not change the result |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
248 call feedkeys(":sign list \<c-d>\<c-c>", 'xt') |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
249 let l = getcompletion('', 'sign') |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
250 call assert_equal(cmds, l) |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
251 let l = getcompletion('list ', 'sign') |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
252 call assert_equal(['Testing'], l) |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
253 endif |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
254 |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
255 " For others test if the name is recognized. |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
256 let names = ['buffer', 'environment', 'file_in_path', |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
257 \ 'mapping', 'shellcmd', 'tag', 'tag_listfiles', 'user'] |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
258 if has('cmdline_hist') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
259 call add(names, 'history') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
260 endif |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
261 if has('gettext') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
262 call add(names, 'locale') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
263 endif |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
264 if has('profile') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
265 call add(names, 'syntime') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
266 endif |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
267 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
268 set tags=Xtags |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
269 call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", "word\tfile\tcmd"], 'Xtags') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
270 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
271 for name in names |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
272 let matchcount = len(getcompletion('', name)) |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
273 call assert_true(matchcount >= 0, 'No matches for ' . name) |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
274 endfor |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
275 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
276 call delete('Xtags') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
277 |
9460
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
278 call assert_fails('call getcompletion("", "burp")', 'E475:') |
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
279 endfunc |
10002
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
280 |
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
281 func Test_expand_star_star() |
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
282 call mkdir('a/b', 'p') |
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
283 call writefile(['asdfasdf'], 'a/b/fileXname') |
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
284 call feedkeys(":find **/fileXname\<Tab>\<CR>", 'xt') |
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
285 call assert_equal('find a/b/fileXname', getreg(':')) |
10007
a4d4ee212dab
commit https://github.com/vim/vim/commit/1773ddfdcd106fa3bbf479c9b62ccde03c2a86ba
Christian Brabandt <cb@256bit.org>
parents:
10002
diff
changeset
|
286 bwipe! |
10002
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
287 call delete('a', 'rf') |
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
288 endfunc |
10452
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
289 |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
290 func Test_paste_in_cmdline() |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
291 let @a = "def" |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
292 call feedkeys(":abc \<C-R>a ghi\<C-B>\"\<CR>", 'tx') |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
293 call assert_equal('"abc def ghi', @:) |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
294 |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
295 new |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
296 call setline(1, 'asdf.x /tmp/some verylongword a;b-c*d ') |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
297 |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
298 call feedkeys(":aaa \<C-R>\<C-W> bbb\<C-B>\"\<CR>", 'tx') |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
299 call assert_equal('"aaa asdf bbb', @:) |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
300 |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
301 call feedkeys("ft:aaa \<C-R>\<C-F> bbb\<C-B>\"\<CR>", 'tx') |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
302 call assert_equal('"aaa /tmp/some bbb', @:) |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
303 |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
304 set incsearch |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
305 call feedkeys("fy:aaa veryl\<C-R>\<C-W> bbb\<C-B>\"\<CR>", 'tx') |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
306 call assert_equal('"aaa verylongword bbb', @:) |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
307 |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
308 call feedkeys("f;:aaa \<C-R>\<C-A> bbb\<C-B>\"\<CR>", 'tx') |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
309 call assert_equal('"aaa a;b-c*d bbb', @:) |
10464
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
310 |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
311 call feedkeys(":\<C-\>etoupper(getline(1))\<CR>\<C-B>\"\<CR>", 'tx') |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
312 call assert_equal('"ASDF.X /TMP/SOME VERYLONGWORD A;B-C*D ', @:) |
10452
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
313 bwipe! |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
314 endfunc |
10464
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
315 |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
316 func Test_remove_char_in_cmdline() |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
317 call feedkeys(":abc def\<S-Left>\<Del>\<C-B>\"\<CR>", 'tx') |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
318 call assert_equal('"abc ef', @:) |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
319 |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
320 call feedkeys(":abc def\<S-Left>\<BS>\<C-B>\"\<CR>", 'tx') |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
321 call assert_equal('"abcdef', @:) |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
322 |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
323 call feedkeys(":abc def ghi\<S-Left>\<C-W>\<C-B>\"\<CR>", 'tx') |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
324 call assert_equal('"abc ghi', @:) |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
325 |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
326 call feedkeys(":abc def\<S-Left>\<C-U>\<C-B>\"\<CR>", 'tx') |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
327 call assert_equal('"def', @:) |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
328 endfunc |
10480
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
329 |
10869
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
330 func Test_illegal_address1() |
10480
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
331 new |
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
332 2;'( |
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
333 2;') |
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
334 quit |
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
335 endfunc |
10694
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
336 |
10869
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
337 func Test_illegal_address2() |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
338 call writefile(['c', 'x', ' x', '.', '1;y'], 'Xtest.vim') |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
339 new |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
340 source Xtest.vim |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
341 " Trigger calling validate_cursor() |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
342 diffsp Xtest.vim |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
343 quit! |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
344 bwipe! |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
345 call delete('Xtest.vim') |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
346 endfunc |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
347 |
10694
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
348 func Test_cmdline_complete_wildoptions() |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
349 help |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
350 call feedkeys(":tag /\<c-a>\<c-b>\"\<cr>", 'tx') |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
351 let a = join(sort(split(@:)),' ') |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
352 set wildoptions=tagfile |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
353 call feedkeys(":tag /\<c-a>\<c-b>\"\<cr>", 'tx') |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
354 let b = join(sort(split(@:)),' ') |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
355 call assert_equal(a, b) |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
356 bw! |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
357 endfunc |
10817
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
358 |
11279
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
359 func Test_cmdline_complete_user_cmd() |
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
360 command! -complete=color -nargs=1 Foo : |
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
361 call feedkeys(":Foo \<Tab>\<Home>\"\<cr>", 'tx') |
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
362 call assert_equal('"Foo blue', @:) |
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
363 call feedkeys(":Foo b\<Tab>\<Home>\"\<cr>", 'tx') |
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
364 call assert_equal('"Foo blue', @:) |
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
365 delcommand Foo |
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
366 endfunc |
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
367 |
12706
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
368 func Test_cmdline_write_alternatefile() |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
369 new |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
370 call setline('.', ['one', 'two']) |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
371 f foo.txt |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
372 new |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
373 f #-A |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
374 call assert_equal('foo.txt-A', expand('%')) |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
375 f #<-B.txt |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
376 call assert_equal('foo-B.txt', expand('%')) |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
377 f %< |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
378 call assert_equal('foo-B', expand('%')) |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
379 new |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
380 call assert_fails('f #<', 'E95') |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
381 bw! |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
382 f foo-B.txt |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
383 f %<-A |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
384 call assert_equal('foo-B-A', expand('%')) |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
385 bw! |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
386 bw! |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
387 endfunc |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
388 |
10817
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
389 " using a leading backslash here |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
390 set cpo+=C |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
391 |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
392 func Test_cmdline_search_range() |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
393 new |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
394 call setline(1, ['a', 'b', 'c', 'd']) |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
395 /d |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
396 1,\/s/b/B/ |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
397 call assert_equal('B', getline(2)) |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
398 |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
399 /a |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
400 $ |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
401 \?,4s/c/C/ |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
402 call assert_equal('C', getline(3)) |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
403 |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
404 call setline(1, ['a', 'b', 'c', 'd']) |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
405 %s/c/c/ |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
406 1,\&s/b/B/ |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
407 call assert_equal('B', getline(2)) |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
408 |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
409 bwipe! |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
410 endfunc |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
411 |
10849
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
412 " Tests for getcmdline(), getcmdpos() and getcmdtype() |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
413 func Check_cmdline(cmdtype) |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
414 call assert_equal('MyCmd a', getcmdline()) |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
415 call assert_equal(8, getcmdpos()) |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
416 call assert_equal(a:cmdtype, getcmdtype()) |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
417 return '' |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
418 endfunc |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
419 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
420 func Test_getcmdtype() |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
421 call feedkeys(":MyCmd a\<C-R>=Check_cmdline(':')\<CR>\<Esc>", "xt") |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
422 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
423 let cmdtype = '' |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
424 debuggreedy |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
425 call feedkeys(":debug echo 'test'\<CR>", "t") |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
426 call feedkeys("let cmdtype = \<C-R>=string(getcmdtype())\<CR>\<CR>", "t") |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
427 call feedkeys("cont\<CR>", "xt") |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
428 0debuggreedy |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
429 call assert_equal('>', cmdtype) |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
430 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
431 call feedkeys("/MyCmd a\<C-R>=Check_cmdline('/')\<CR>\<Esc>", "xt") |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
432 call feedkeys("?MyCmd a\<C-R>=Check_cmdline('?')\<CR>\<Esc>", "xt") |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
433 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
434 call feedkeys(":call input('Answer?')\<CR>", "t") |
10867
9a5a4b36a1c1
patch 8.0.0323: one second pause when running cmdline test
Christian Brabandt <cb@256bit.org>
parents:
10849
diff
changeset
|
435 call feedkeys("MyCmd a\<C-R>=Check_cmdline('@')\<CR>\<C-C>", "xt") |
10849
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
436 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
437 call feedkeys(":insert\<CR>MyCmd a\<C-R>=Check_cmdline('-')\<CR>\<Esc>", "xt") |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
438 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
439 cnoremap <expr> <F6> Check_cmdline('=') |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
440 call feedkeys("a\<C-R>=MyCmd a\<F6>\<Esc>\<Esc>", "xt") |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
441 cunmap <F6> |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
442 endfunc |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
443 |
11323
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
444 func Test_verbosefile() |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
445 set verbosefile=Xlog |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
446 echomsg 'foo' |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
447 echomsg 'bar' |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
448 set verbosefile= |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
449 let log = readfile('Xlog') |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
450 call assert_match("foo\nbar", join(log, "\n")) |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
451 call delete('Xlog') |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
452 endfunc |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
453 |
10817
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
454 set cpo& |