annotate src/testdir/test_cmdline.vim @ 19613:9c15be376631 v8.2.0363

patch 8.2.0363: some Normal mode commands not tested Commit: https://github.com/vim/vim/commit/f5f1e10d0d39890298cdf27f664d466c8872b87e Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 8 05:13:15 2020 +0100 patch 8.2.0363: some Normal mode commands not tested Problem: Some Normal mode commands not tested. Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5746)
author Bram Moolenaar <Bram@vim.org>
date Sun, 08 Mar 2020 05:15:04 +0100
parents 848dc460adf0
children f70a3c1000bb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
18297
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
3 source check.vim
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
4 source screendump.vim
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
5
9280
f92cfcd7fda2 commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 func Test_complete_tab()
f92cfcd7fda2 commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 call writefile(['testfile'], 'Xtestfile')
f92cfcd7fda2 commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 call feedkeys(":e Xtest\t\r", "tx")
f92cfcd7fda2 commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 call assert_equal('testfile', getline(1))
f92cfcd7fda2 commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 call delete('Xtestfile')
f92cfcd7fda2 commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 endfunc
f92cfcd7fda2 commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12
f92cfcd7fda2 commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 func Test_complete_list()
f92cfcd7fda2 commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 " 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
15 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
16 call assert_equal('test', expand('%:t'))
19536
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
17
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
18 " If a command doesn't support completion, then CTRL-D should be literally
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
19 " used.
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
20 call feedkeys(":chistory \<C-D>\<C-B>\"\<CR>", 'xt')
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
21 call assert_equal("\"chistory \<C-D>", @:)
9280
f92cfcd7fda2 commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 endfunc
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 func Test_complete_wildmenu()
16117
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
25 call mkdir('Xdir1/Xdir2', 'p')
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
26 call writefile(['testfile1'], 'Xdir1/Xtestfile1')
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
27 call writefile(['testfile2'], 'Xdir1/Xtestfile2')
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
28 call writefile(['testfile3'], 'Xdir1/Xdir2/Xtestfile3')
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
29 call writefile(['testfile3'], 'Xdir1/Xdir2/Xtestfile4')
9280
f92cfcd7fda2 commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 set wildmenu
16117
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
31
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
32 " Pressing <Tab> completes, and moves to next files when pressing again.
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
33 call feedkeys(":e Xdir1/\<Tab>\<Tab>\<CR>", 'tx')
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
34 call assert_equal('testfile1', getline(1))
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
35 call feedkeys(":e Xdir1/\<Tab>\<Tab>\<Tab>\<CR>", 'tx')
9280
f92cfcd7fda2 commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 call assert_equal('testfile2', getline(1))
f92cfcd7fda2 commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37
16117
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
38 " <S-Tab> is like <Tab> but begin with the last match and then go to
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
39 " previous.
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
40 call feedkeys(":e Xdir1/Xtest\<S-Tab>\<CR>", 'tx')
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
41 call assert_equal('testfile2', getline(1))
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
42 call feedkeys(":e Xdir1/Xtest\<S-Tab>\<S-Tab>\<CR>", 'tx')
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
43 call assert_equal('testfile1', getline(1))
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
44
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
45 " <Left>/<Right> to move to previous/next file.
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
46 call feedkeys(":e Xdir1/\<Tab>\<Right>\<CR>", 'tx')
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
47 call assert_equal('testfile1', getline(1))
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
48 call feedkeys(":e Xdir1/\<Tab>\<Right>\<Right>\<CR>", 'tx')
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
49 call assert_equal('testfile2', getline(1))
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
50 call feedkeys(":e Xdir1/\<Tab>\<Right>\<Right>\<Left>\<CR>", 'tx')
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
51 call assert_equal('testfile1', getline(1))
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
52
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
53 " <Up>/<Down> to go up/down directories.
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
54 call feedkeys(":e Xdir1/\<Tab>\<Down>\<CR>", 'tx')
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
55 call assert_equal('testfile3', getline(1))
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
56 call feedkeys(":e Xdir1/\<Tab>\<Down>\<Up>\<Right>\<CR>", 'tx')
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
57 call assert_equal('testfile1', getline(1))
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
58
19536
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
59 " Test for canceling the wild menu by adding a character
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
60 redrawstatus
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
61 call feedkeys(":e Xdir1/\<Tab>x\<C-B>\"\<CR>", 'xt')
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
62 call assert_equal('"e Xdir1/Xdir2/x', @:)
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
63
19517
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
64 " Completion using a relative path
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
65 cd Xdir1/Xdir2
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
66 call feedkeys(":e ../\<Tab>\<Right>\<Down>\<C-A>\<C-B>\"\<CR>", 'tx')
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
67 call assert_equal('"e Xtestfile3 Xtestfile4', @:)
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
68 cd -
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
69
16117
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
70 " cleanup
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
71 %bwipe
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
72 call delete('Xdir1/Xdir2/Xtestfile4')
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
73 call delete('Xdir1/Xdir2/Xtestfile3')
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
74 call delete('Xdir1/Xtestfile2')
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
75 call delete('Xdir1/Xtestfile1')
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
76 call delete('Xdir1/Xdir2', 'd')
dd15295b94fe patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents: 15657
diff changeset
77 call delete('Xdir1', 'd')
9280
f92cfcd7fda2 commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
78 set nowildmenu
f92cfcd7fda2 commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
79 endfunc
9460
cdffa812f9d1 commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents: 9280
diff changeset
80
11026
fa69f6272692 patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents: 10869
diff changeset
81 func Test_map_completion()
fa69f6272692 patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents: 10869
diff changeset
82 if !has('cmdline_compl')
fa69f6272692 patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents: 10869
diff changeset
83 return
fa69f6272692 patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents: 10869
diff changeset
84 endif
fa69f6272692 patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents: 10869
diff changeset
85 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
86 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
87 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
88 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
89 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
90 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
91 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
92 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
93 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
94 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
95 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
96 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
97 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
98 call assert_equal('"map <silent> <special>', getreg(':'))
16495
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
99
16497
ac4e38fbae9d patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents: 16495
diff changeset
100 map <Middle>x middle
ac4e38fbae9d patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents: 16495
diff changeset
101
16495
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
102 map ,f commaf
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
103 map ,g commaf
16497
ac4e38fbae9d patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents: 16495
diff changeset
104 map <Left> left
ac4e38fbae9d patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents: 16495
diff changeset
105 map <A-Left>x shiftleft
16495
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
106 call feedkeys(":map ,\<Tab>\<Home>\"\<CR>", 'xt')
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
107 call assert_equal('"map ,f', getreg(':'))
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
108 call feedkeys(":map ,\<Tab>\<Tab>\<Home>\"\<CR>", 'xt')
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
109 call assert_equal('"map ,g', getreg(':'))
16497
ac4e38fbae9d patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents: 16495
diff changeset
110 call feedkeys(":map <L\<Tab>\<Home>\"\<CR>", 'xt')
ac4e38fbae9d patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents: 16495
diff changeset
111 call assert_equal('"map <Left>', getreg(':'))
ac4e38fbae9d patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents: 16495
diff changeset
112 call feedkeys(":map <A-Left>\<Tab>\<Home>\"\<CR>", 'xt')
16499
0f0de1fb70a2 patch 8.1.1253: mapping completion test fails
Bram Moolenaar <Bram@vim.org>
parents: 16497
diff changeset
113 call assert_equal("\"map <A-Left>\<Tab>", getreg(':'))
16495
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
114 unmap ,f
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
115 unmap ,g
16497
ac4e38fbae9d patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents: 16495
diff changeset
116 unmap <Left>
ac4e38fbae9d patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents: 16495
diff changeset
117 unmap <A-Left>x
16495
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
118
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
119 set cpo-=< cpo-=B cpo-=k
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
120 map <Left> left
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
121 call feedkeys(":map <L\<Tab>\<Home>\"\<CR>", 'xt')
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
122 call assert_equal('"map <Left>', getreg(':'))
16497
ac4e38fbae9d patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents: 16495
diff changeset
123 call feedkeys(":map <M\<Tab>\<Home>\"\<CR>", 'xt')
16499
0f0de1fb70a2 patch 8.1.1253: mapping completion test fails
Bram Moolenaar <Bram@vim.org>
parents: 16497
diff changeset
124 call assert_equal("\"map <M\<Tab>", getreg(':'))
16495
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
125 unmap <Left>
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
126
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
127 set cpo+=<
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
128 map <Left> left
16501
5273b506b050 patch 8.1.1254: mapping completion contains dead code
Bram Moolenaar <Bram@vim.org>
parents: 16499
diff changeset
129 exe "set t_k6=\<Esc>[17~"
5273b506b050 patch 8.1.1254: mapping completion contains dead code
Bram Moolenaar <Bram@vim.org>
parents: 16499
diff changeset
130 call feedkeys(":map \<Esc>[17~x f6x\<CR>", 'xt')
16495
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
131 call feedkeys(":map <L\<Tab>\<Home>\"\<CR>", 'xt')
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
132 call assert_equal('"map <Left>', getreg(':'))
16529
1c8a90c4d2a1 patch 8.1.1268: map completion test fails in GUI
Bram Moolenaar <Bram@vim.org>
parents: 16501
diff changeset
133 if !has('gui_running')
1c8a90c4d2a1 patch 8.1.1268: map completion test fails in GUI
Bram Moolenaar <Bram@vim.org>
parents: 16501
diff changeset
134 call feedkeys(":map \<Esc>[17~\<Tab>\<Home>\"\<CR>", 'xt')
1c8a90c4d2a1 patch 8.1.1268: map completion test fails in GUI
Bram Moolenaar <Bram@vim.org>
parents: 16501
diff changeset
135 call assert_equal("\"map <F6>x", getreg(':'))
1c8a90c4d2a1 patch 8.1.1268: map completion test fails in GUI
Bram Moolenaar <Bram@vim.org>
parents: 16501
diff changeset
136 endif
16495
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
137 unmap <Left>
16501
5273b506b050 patch 8.1.1254: mapping completion contains dead code
Bram Moolenaar <Bram@vim.org>
parents: 16499
diff changeset
138 call feedkeys(":unmap \<Esc>[17~x\<CR>", 'xt')
16495
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
139 set cpo-=<
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
140
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
141 set cpo+=B
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
142 map <Left> left
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
143 call feedkeys(":map <L\<Tab>\<Home>\"\<CR>", 'xt')
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
144 call assert_equal('"map <Left>', getreg(':'))
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
145 unmap <Left>
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
146 set cpo-=B
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
147
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
148 set cpo+=k
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
149 map <Left> left
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
150 call feedkeys(":map <L\<Tab>\<Home>\"\<CR>", 'xt')
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
151 call assert_equal('"map <Left>', getreg(':'))
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
152 unmap <Left>
899db156cce3 patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents: 16117
diff changeset
153 set cpo-=k
16497
ac4e38fbae9d patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents: 16495
diff changeset
154
ac4e38fbae9d patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents: 16495
diff changeset
155 unmap <Middle>x
ac4e38fbae9d patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents: 16495
diff changeset
156 set cpo&vim
11026
fa69f6272692 patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents: 10869
diff changeset
157 endfunc
fa69f6272692 patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents: 10869
diff changeset
158
10660
715836a72361 patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents: 10656
diff changeset
159 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
160 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
161 return
715836a72361 patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents: 10656
diff changeset
162 endif
715836a72361 patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents: 10656
diff changeset
163 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
164 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
165 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
166 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
167 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
168 endfunc
715836a72361 patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents: 10656
diff changeset
169
715836a72361 patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents: 10656
diff changeset
170 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
171 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
172 return
715836a72361 patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents: 10656
diff changeset
173 endif
715836a72361 patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents: 10656
diff changeset
174 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
175 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
176 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
177 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
178 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
179 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
180 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
181 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
182 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
183 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
184 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
185 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
186 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
187
918942a3b0ef patch 8.0.0513: getting name of cleared highlight group is wrong
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
188 " 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
189 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
190 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
191 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
192 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
193 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
194 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
195 endfunc
715836a72361 patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents: 10656
diff changeset
196
10656
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
197 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
198 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
199 return
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
200 endif
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
201 for cmd in [
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
202 \ 'let a = ',
18713
baf890fa1621 patch 8.1.2348: :const cannot be followed by "| endif"
Bram Moolenaar <Bram@vim.org>
parents: 18467
diff changeset
203 \ 'const a = ',
10656
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
204 \ 'if',
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
205 \ 'elseif',
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
206 \ 'while',
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
207 \ 'for',
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
208 \ 'echo',
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
209 \ 'echon',
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
210 \ 'execute',
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
211 \ 'echomsg',
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
212 \ 'echoerr',
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
213 \ 'call',
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
214 \ 'return',
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
215 \ 'cexpr',
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
216 \ 'caddexpr',
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
217 \ 'cgetexpr',
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
218 \ 'lexpr',
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
219 \ 'laddexpr',
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
220 \ 'lgetexpr']
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
221 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
222 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
223 endfor
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
224 endfunc
4762bd300564 patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents: 10480
diff changeset
225
9460
cdffa812f9d1 commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents: 9280
diff changeset
226 func Test_getcompletion()
9462
7384c0cfad13 commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents: 9460
diff changeset
227 if !has('cmdline_compl')
7384c0cfad13 commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents: 9460
diff changeset
228 return
7384c0cfad13 commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents: 9460
diff changeset
229 endif
9460
cdffa812f9d1 commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents: 9280
diff changeset
230 let groupcount = len(getcompletion('', 'event'))
cdffa812f9d1 commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents: 9280
diff changeset
231 call assert_true(groupcount > 0)
17857
4935244c1128 patch 8.1.1925: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17093
diff changeset
232 let matchcount = len('File'->getcompletion('event'))
9460
cdffa812f9d1 commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents: 9280
diff changeset
233 call assert_true(matchcount > 0)
cdffa812f9d1 commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents: 9280
diff changeset
234 call assert_true(groupcount > matchcount)
cdffa812f9d1 commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents: 9280
diff changeset
235
9462
7384c0cfad13 commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents: 9460
diff changeset
236 if has('menu')
7384c0cfad13 commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents: 9460
diff changeset
237 source $VIMRUNTIME/menu.vim
7384c0cfad13 commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents: 9460
diff changeset
238 let matchcount = len(getcompletion('', 'menu'))
7384c0cfad13 commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents: 9460
diff changeset
239 call assert_true(matchcount > 0)
7384c0cfad13 commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents: 9460
diff changeset
240 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
241 call assert_true(matchcount > 0)
7384c0cfad13 commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents: 9460
diff changeset
242 let matchcount = len(getcompletion('File.', 'menu'))
7384c0cfad13 commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents: 9460
diff changeset
243 call assert_true(matchcount > 0)
7384c0cfad13 commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents: 9460
diff changeset
244 endif
9460
cdffa812f9d1 commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents: 9280
diff changeset
245
9577
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
246 let l = getcompletion('v:n', 'var')
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
247 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
248 let l = getcompletion('v:notexists', 'var')
6255ff1ea003 commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents: 9638
diff changeset
249 call assert_equal([], l)
9577
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
250
13551
1fd0f8392946 patch 8.0.1649: no completion for argument list commands
Christian Brabandt <cb@256bit.org>
parents: 12706
diff changeset
251 args a.c b.c
1fd0f8392946 patch 8.0.1649: no completion for argument list commands
Christian Brabandt <cb@256bit.org>
parents: 12706
diff changeset
252 let l = getcompletion('', 'arglist')
1fd0f8392946 patch 8.0.1649: no completion for argument list commands
Christian Brabandt <cb@256bit.org>
parents: 12706
diff changeset
253 call assert_equal(['a.c', 'b.c'], l)
1fd0f8392946 patch 8.0.1649: no completion for argument list commands
Christian Brabandt <cb@256bit.org>
parents: 12706
diff changeset
254 %argdelete
1fd0f8392946 patch 8.0.1649: no completion for argument list commands
Christian Brabandt <cb@256bit.org>
parents: 12706
diff changeset
255
9577
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
256 let l = getcompletion('', 'augroup')
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
257 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
258 let l = getcompletion('blahblah', 'augroup')
6255ff1ea003 commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents: 9638
diff changeset
259 call assert_equal([], l)
9577
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
260
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
261 let l = getcompletion('', 'behave')
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
262 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
263 let l = getcompletion('not', 'behave')
6255ff1ea003 commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents: 9638
diff changeset
264 call assert_equal([], l)
9577
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
265
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
266 let l = getcompletion('', 'color')
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
267 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
268 let l = getcompletion('dirty', 'color')
6255ff1ea003 commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents: 9638
diff changeset
269 call assert_equal([], l)
9577
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 let l = getcompletion('', 'command')
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
272 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
273 let l = getcompletion('awake', 'command')
6255ff1ea003 commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents: 9638
diff changeset
274 call assert_equal([], l)
9577
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 let l = getcompletion('', 'dir')
9672
6255ff1ea003 commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents: 9638
diff changeset
277 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
278 let l = getcompletion('NoMatch', 'dir')
6255ff1ea003 commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents: 9638
diff changeset
279 call assert_equal([], l)
9577
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
280
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
281 let l = getcompletion('exe', 'expression')
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
282 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
283 let l = getcompletion('kill', 'expression')
6255ff1ea003 commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents: 9638
diff changeset
284 call assert_equal([], l)
9577
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
285
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
286 let l = getcompletion('tag', 'function')
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
287 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
288 let l = getcompletion('paint', 'function')
6255ff1ea003 commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents: 9638
diff changeset
289 call assert_equal([], l)
9577
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
290
9638
af0d98d8836e commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038
Christian Brabandt <cb@256bit.org>
parents: 9577
diff changeset
291 let Flambda = {-> 'hello'}
af0d98d8836e commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038
Christian Brabandt <cb@256bit.org>
parents: 9577
diff changeset
292 let l = getcompletion('', 'function')
af0d98d8836e commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038
Christian Brabandt <cb@256bit.org>
parents: 9577
diff changeset
293 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
294 call assert_equal([], l)
9638
af0d98d8836e commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038
Christian Brabandt <cb@256bit.org>
parents: 9577
diff changeset
295
9577
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
296 let l = getcompletion('run', 'file')
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
297 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
298 let l = getcompletion('walk', 'file')
6255ff1ea003 commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents: 9638
diff changeset
299 call assert_equal([], l)
9861
74f67cb4f7e1 commit https://github.com/vim/vim/commit/e9d58a6459687a1228b5aa85bd7b31f8f1e528a8
Christian Brabandt <cb@256bit.org>
parents: 9774
diff changeset
300 set wildignore=*.vim
74f67cb4f7e1 commit https://github.com/vim/vim/commit/e9d58a6459687a1228b5aa85bd7b31f8f1e528a8
Christian Brabandt <cb@256bit.org>
parents: 9774
diff changeset
301 let l = getcompletion('run', 'file', 1)
74f67cb4f7e1 commit https://github.com/vim/vim/commit/e9d58a6459687a1228b5aa85bd7b31f8f1e528a8
Christian Brabandt <cb@256bit.org>
parents: 9774
diff changeset
302 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
303 set wildignore&
9577
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
304
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
305 let l = getcompletion('ha', 'filetype')
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
306 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
307 let l = getcompletion('horse', 'filetype')
6255ff1ea003 commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents: 9638
diff changeset
308 call assert_equal([], l)
9577
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
309
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
310 let l = getcompletion('z', 'syntax')
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
311 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
312 let l = getcompletion('emacs', 'syntax')
6255ff1ea003 commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents: 9638
diff changeset
313 call assert_equal([], l)
9577
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
314
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
315 let l = getcompletion('jikes', 'compiler')
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
316 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
317 let l = getcompletion('break', 'compiler')
6255ff1ea003 commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents: 9638
diff changeset
318 call assert_equal([], l)
9577
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
319
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
320 let l = getcompletion('last', 'help')
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
321 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
322 let l = getcompletion('giveup', 'help')
6255ff1ea003 commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents: 9638
diff changeset
323 call assert_equal([], l)
9577
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
324
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
325 let l = getcompletion('time', 'option')
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
326 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
327 let l = getcompletion('space', 'option')
6255ff1ea003 commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents: 9638
diff changeset
328 call assert_equal([], l)
9577
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
329
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
330 let l = getcompletion('er', 'highlight')
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
331 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
332 let l = getcompletion('dark', 'highlight')
6255ff1ea003 commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents: 9638
diff changeset
333 call assert_equal([], l)
9577
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
334
10275
6d8b2da002e9 commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents: 10007
diff changeset
335 let l = getcompletion('', 'messages')
6d8b2da002e9 commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents: 10007
diff changeset
336 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
337 let l = getcompletion('not', 'messages')
6d8b2da002e9 commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents: 10007
diff changeset
338 call assert_equal([], l)
6d8b2da002e9 commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents: 10007
diff changeset
339
11995
7df3dd3c0ac1 patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents: 11354
diff changeset
340 let l = getcompletion('', 'mapclear')
7df3dd3c0ac1 patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents: 11354
diff changeset
341 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
342 let l = getcompletion('not', 'mapclear')
7df3dd3c0ac1 patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents: 11354
diff changeset
343 call assert_equal([], l)
7df3dd3c0ac1 patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents: 11354
diff changeset
344
13998
c3f9c37160e7 patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents: 13890
diff changeset
345 let l = getcompletion('.', 'shellcmd')
14417
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
346 call assert_equal(['./', '../'], filter(l, 'v:val =~ "\\./"'))
13998
c3f9c37160e7 patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents: 13890
diff changeset
347 call assert_equal(-1, match(l[2:], '^\.\.\?/$'))
c3f9c37160e7 patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents: 13890
diff changeset
348 let root = has('win32') ? 'C:\\' : '/'
c3f9c37160e7 patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents: 13890
diff changeset
349 let l = getcompletion(root, 'shellcmd')
c3f9c37160e7 patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents: 13890
diff changeset
350 let expected = map(filter(glob(root . '*', 0, 1),
c3f9c37160e7 patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents: 13890
diff changeset
351 \ 'isdirectory(v:val) || executable(v:val)'), 'isdirectory(v:val) ? v:val . ''/'' : v:val')
c3f9c37160e7 patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents: 13890
diff changeset
352 call assert_equal(expected, l)
c3f9c37160e7 patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents: 13890
diff changeset
353
9766
be9b5f8c3fd9 commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents: 9672
diff changeset
354 if has('cscope')
be9b5f8c3fd9 commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents: 9672
diff changeset
355 let l = getcompletion('', 'cscope')
be9b5f8c3fd9 commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents: 9672
diff changeset
356 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
357 call assert_equal(cmds, l)
be9b5f8c3fd9 commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents: 9672
diff changeset
358 " 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
359 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
360 let l = getcompletion('', 'cscope')
be9b5f8c3fd9 commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents: 9672
diff changeset
361 call assert_equal(cmds, l)
be9b5f8c3fd9 commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents: 9672
diff changeset
362 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
363 let l = getcompletion('find ', 'cscope')
be9b5f8c3fd9 commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents: 9672
diff changeset
364 call assert_equal(keys, l)
be9b5f8c3fd9 commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents: 9672
diff changeset
365 endif
be9b5f8c3fd9 commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents: 9672
diff changeset
366
9774
5385e72e1ac2 commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents: 9766
diff changeset
367 if has('signs')
5385e72e1ac2 commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents: 9766
diff changeset
368 sign define Testing linehl=Comment
5385e72e1ac2 commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents: 9766
diff changeset
369 let l = getcompletion('', 'sign')
5385e72e1ac2 commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents: 9766
diff changeset
370 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
371 call assert_equal(cmds, l)
5385e72e1ac2 commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents: 9766
diff changeset
372 " 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
373 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
374 let l = getcompletion('', 'sign')
5385e72e1ac2 commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents: 9766
diff changeset
375 call assert_equal(cmds, l)
5385e72e1ac2 commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents: 9766
diff changeset
376 let l = getcompletion('list ', 'sign')
5385e72e1ac2 commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents: 9766
diff changeset
377 call assert_equal(['Testing'], l)
5385e72e1ac2 commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents: 9766
diff changeset
378 endif
5385e72e1ac2 commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents: 9766
diff changeset
379
9577
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
380 " For others test if the name is recognized.
13998
c3f9c37160e7 patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents: 13890
diff changeset
381 let names = ['buffer', 'environment', 'file_in_path', 'mapping', 'tag', 'tag_listfiles', 'user']
9577
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
382 if has('cmdline_hist')
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
383 call add(names, 'history')
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
384 endif
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
385 if has('gettext')
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
386 call add(names, 'locale')
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
387 endif
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
388 if has('profile')
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
389 call add(names, 'syntime')
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
390 endif
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
391
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
392 set tags=Xtags
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
393 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
394
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
395 for name in names
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
396 let matchcount = len(getcompletion('', name))
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
397 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
398 endfor
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
399
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
400 call delete('Xtags')
17093
5cda6165a5c1 patch 8.1.1546: in some tests 'tags' is set but not restored
Bram Moolenaar <Bram@vim.org>
parents: 16529
diff changeset
401 set tags&
9577
e3b6a4a87684 commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents: 9462
diff changeset
402
9460
cdffa812f9d1 commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents: 9280
diff changeset
403 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
404 endfunc
10002
ff0b4216f026 commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents: 9861
diff changeset
405
14417
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
406 func Test_shellcmd_completion()
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
407 let save_path = $PATH
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
408
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
409 call mkdir('Xpathdir/Xpathsubdir', 'p')
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
410 call writefile([''], 'Xpathdir/Xfile.exe')
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
411 call setfperm('Xpathdir/Xfile.exe', 'rwx------')
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
412
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
413 " Set PATH to example directory without trailing slash.
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
414 let $PATH = getcwd() . '/Xpathdir'
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
415
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
416 " Test for the ":!<TAB>" case. Previously, this would include subdirs of
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
417 " dirs in the PATH, even though they won't be executed. We check that only
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
418 " subdirs of the PWD and executables from the PATH are included in the
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
419 " suggestions.
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
420 let actual = getcompletion('X', 'shellcmd')
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
421 let expected = map(filter(glob('*', 0, 1), 'isdirectory(v:val) && v:val[0] == "X"'), 'v:val . "/"')
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
422 call insert(expected, 'Xfile.exe')
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
423 call assert_equal(expected, actual)
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
424
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
425 call delete('Xpathdir', 'rf')
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
426 let $PATH = save_path
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
427 endfunc
5d9b450e7827 patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents: 14167
diff changeset
428
10002
ff0b4216f026 commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents: 9861
diff changeset
429 func Test_expand_star_star()
ff0b4216f026 commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents: 9861
diff changeset
430 call mkdir('a/b', 'p')
ff0b4216f026 commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents: 9861
diff changeset
431 call writefile(['asdfasdf'], 'a/b/fileXname')
ff0b4216f026 commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents: 9861
diff changeset
432 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
433 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
434 bwipe!
10002
ff0b4216f026 commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents: 9861
diff changeset
435 call delete('a', 'rf')
ff0b4216f026 commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents: 9861
diff changeset
436 endfunc
10452
3fab458a54ad commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents: 10275
diff changeset
437
18924
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
438 func Test_cmdline_paste()
10452
3fab458a54ad commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents: 10275
diff changeset
439 let @a = "def"
3fab458a54ad commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents: 10275
diff changeset
440 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
441 call assert_equal('"abc def ghi', @:)
3fab458a54ad commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents: 10275
diff changeset
442
3fab458a54ad commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents: 10275
diff changeset
443 new
3fab458a54ad commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents: 10275
diff changeset
444 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
445
3fab458a54ad commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents: 10275
diff changeset
446 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
447 call assert_equal('"aaa asdf bbb', @:)
3fab458a54ad commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents: 10275
diff changeset
448
3fab458a54ad commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents: 10275
diff changeset
449 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
450 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
451
13831
1f95ec5de238 patch 8.0.1787: cannot insert the whole cursor line
Christian Brabandt <cb@256bit.org>
parents: 13600
diff changeset
452 call feedkeys(":aaa \<C-R>\<C-L> bbb\<C-B>\"\<CR>", 'tx')
1f95ec5de238 patch 8.0.1787: cannot insert the whole cursor line
Christian Brabandt <cb@256bit.org>
parents: 13600
diff changeset
453 call assert_equal('"aaa '.getline(1).' bbb', @:)
1f95ec5de238 patch 8.0.1787: cannot insert the whole cursor line
Christian Brabandt <cb@256bit.org>
parents: 13600
diff changeset
454
10452
3fab458a54ad commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents: 10275
diff changeset
455 set incsearch
3fab458a54ad commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents: 10275
diff changeset
456 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
457 call assert_equal('"aaa verylongword bbb', @:)
3fab458a54ad commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents: 10275
diff changeset
458
3fab458a54ad commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents: 10275
diff changeset
459 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
460 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
461
ce8ef728a12e commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents: 10452
diff changeset
462 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
463 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
464 bwipe!
13600
75e35ebdb7a4 patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents: 13551
diff changeset
465
75e35ebdb7a4 patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents: 13551
diff changeset
466 " Error while typing a command used to cause that it was not executed
75e35ebdb7a4 patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents: 13551
diff changeset
467 " in the end.
75e35ebdb7a4 patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents: 13551
diff changeset
468 new
75e35ebdb7a4 patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents: 13551
diff changeset
469 try
75e35ebdb7a4 patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents: 13551
diff changeset
470 call feedkeys(":file \<C-R>%Xtestfile\<CR>", 'tx')
75e35ebdb7a4 patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents: 13551
diff changeset
471 catch /^Vim\%((\a\+)\)\=:E32/
75e35ebdb7a4 patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents: 13551
diff changeset
472 " ignore error E32
75e35ebdb7a4 patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents: 13551
diff changeset
473 endtry
75e35ebdb7a4 patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents: 13551
diff changeset
474 call assert_equal("Xtestfile", bufname("%"))
19517
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
475
19536
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
476 " Try to paste an invalid register using <C-R>
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
477 call feedkeys(":\"one\<C-R>\<C-X>two\<CR>", 'xt')
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
478 call assert_equal('"onetwo', @:)
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
479
19581
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
480 " Test for pasting register containing CTRL-H using CTRL-R and CTRL-R CTRL-R
19536
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
481 let @a = "xy\<C-H>z"
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
482 call feedkeys(":\"\<C-R>a\<CR>", 'xt')
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
483 call assert_equal('"xz', @:)
19581
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
484 call feedkeys(":\"\<C-R>\<C-R>a\<CR>", 'xt')
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
485 call assert_equal("\"xy\<C-H>z", @:)
19536
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
486 call feedkeys(":\"\<C-R>\<C-O>a\<CR>", 'xt')
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
487 call assert_equal("\"xy\<C-H>z", @:)
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
488
19581
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
489 " Test for pasting register containing CTRL-V using CTRL-R and CTRL-R CTRL-R
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
490 let @a = "xy\<C-V>z"
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
491 call feedkeys(":\"\<C-R>=@a\<CR>\<cr>", 'xt')
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
492 call assert_equal('"xyz', @:)
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
493 call feedkeys(":\"\<C-R>\<C-R>=@a\<CR>\<cr>", 'xt')
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
494 call assert_equal("\"xy\<C-V>z", @:)
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
495
19536
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
496 call assert_beeps('call feedkeys(":\<C-R>=\<C-R>=\<Esc>", "xt")')
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
497
13600
75e35ebdb7a4 patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents: 13551
diff changeset
498 bwipe!
10452
3fab458a54ad commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents: 10275
diff changeset
499 endfunc
10464
ce8ef728a12e commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents: 10452
diff changeset
500
18924
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
501 func Test_cmdline_remove_char()
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
502 let encoding_save = &encoding
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
503
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
504 for e in ['utf8', 'latin1']
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
505 exe 'set encoding=' . e
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
506
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
507 call feedkeys(":abc def\<S-Left>\<Del>\<C-B>\"\<CR>", 'tx')
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
508 call assert_equal('"abc ef', @:, e)
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
509
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
510 call feedkeys(":abc def\<S-Left>\<BS>\<C-B>\"\<CR>", 'tx')
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
511 call assert_equal('"abcdef', @:)
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
512
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
513 call feedkeys(":abc def ghi\<S-Left>\<C-W>\<C-B>\"\<CR>", 'tx')
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
514 call assert_equal('"abc ghi', @:, e)
10464
ce8ef728a12e commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents: 10452
diff changeset
515
18924
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
516 call feedkeys(":abc def\<S-Left>\<C-U>\<C-B>\"\<CR>", 'tx')
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
517 call assert_equal('"def', @:, e)
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
518 endfor
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
519
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
520 let &encoding = encoding_save
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
521 endfunc
10464
ce8ef728a12e commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents: 10452
diff changeset
522
18924
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
523 func Test_cmdline_keymap_ctrl_hat()
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
524 if !has('keymap')
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
525 return
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
526 endif
10464
ce8ef728a12e commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents: 10452
diff changeset
527
18924
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
528 set keymap=esperanto
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
529 call feedkeys(":\"Jxauxdo \<C-^>Jxauxdo \<C-^>Jxauxdo\<CR>", 'tx')
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
530 call assert_equal('"Jxauxdo Ĵaŭdo Jxauxdo', @:)
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
531 set keymap=
10464
ce8ef728a12e commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents: 10452
diff changeset
532 endfunc
10480
dc9326b58c33 commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents: 10464
diff changeset
533
10869
f8ebfa168818 patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents: 10867
diff changeset
534 func Test_illegal_address1()
10480
dc9326b58c33 commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents: 10464
diff changeset
535 new
dc9326b58c33 commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents: 10464
diff changeset
536 2;'(
dc9326b58c33 commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents: 10464
diff changeset
537 2;')
dc9326b58c33 commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents: 10464
diff changeset
538 quit
dc9326b58c33 commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents: 10464
diff changeset
539 endfunc
10694
fa6c4825a1c4 patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents: 10660
diff changeset
540
10869
f8ebfa168818 patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents: 10867
diff changeset
541 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
542 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
543 new
f8ebfa168818 patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents: 10867
diff changeset
544 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
545 " 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
546 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
547 quit!
f8ebfa168818 patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents: 10867
diff changeset
548 bwipe!
f8ebfa168818 patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents: 10867
diff changeset
549 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
550 endfunc
f8ebfa168818 patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents: 10867
diff changeset
551
10694
fa6c4825a1c4 patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents: 10660
diff changeset
552 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
553 help
fa6c4825a1c4 patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents: 10660
diff changeset
554 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
555 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
556 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
557 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
558 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
559 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
560 bw!
fa6c4825a1c4 patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents: 10660
diff changeset
561 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
562
11279
b19377368387 patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents: 11254
diff changeset
563 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
564 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
565 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
566 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
567 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
568 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
569 delcommand Foo
b19377368387 patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents: 11254
diff changeset
570 endfunc
b19377368387 patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents: 11254
diff changeset
571
19556
ff5048b0ccfe patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents: 19550
diff changeset
572 func s:ScriptLocalFunction()
ff5048b0ccfe patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents: 19550
diff changeset
573 echo 'yes'
ff5048b0ccfe patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents: 19550
diff changeset
574 endfunc
ff5048b0ccfe patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents: 19550
diff changeset
575
ff5048b0ccfe patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents: 19550
diff changeset
576 func Test_cmdline_complete_user_func()
ff5048b0ccfe patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents: 19550
diff changeset
577 call feedkeys(":func Test_cmdline_complete_user\<Tab>\<Home>\"\<cr>", 'tx')
ff5048b0ccfe patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents: 19550
diff changeset
578 call assert_match('"func Test_cmdline_complete_user', @:)
ff5048b0ccfe patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents: 19550
diff changeset
579 call feedkeys(":func s:ScriptL\<Tab>\<Home>\"\<cr>", 'tx')
ff5048b0ccfe patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents: 19550
diff changeset
580 call assert_match('"func <SNR>\d\+_ScriptLocalFunction', @:)
ff5048b0ccfe patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents: 19550
diff changeset
581 endfunc
ff5048b0ccfe patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents: 19550
diff changeset
582
14135
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
583 func Test_cmdline_complete_user_names()
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
584 if has('unix') && executable('whoami')
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
585 let whoami = systemlist('whoami')[0]
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
586 let first_letter = whoami[0]
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
587 if len(first_letter) > 0
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
588 " Trying completion of :e ~x where x is the first letter of
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
589 " the user name should complete to at least the user name.
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
590 call feedkeys(':e ~' . first_letter . "\<c-a>\<c-B>\"\<cr>", 'tx')
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
591 call assert_match('^"e \~.*\<' . whoami . '\>', @:)
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
592 endif
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
593 endif
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
594 if has('win32')
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
595 " Just in case: check that the system has an Administrator account.
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
596 let names = system('net user')
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
597 if names =~ 'Administrator'
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
598 " Trying completion of :e ~A should complete to Administrator.
15657
c2c4fb3379e8 patch 8.1.0836: user completion test can fail on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
599 " There could be other names starting with "A" before Administrator.
14135
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
600 call feedkeys(':e ~A' . "\<c-a>\<c-B>\"\<cr>", 'tx')
15657
c2c4fb3379e8 patch 8.1.0836: user completion test can fail on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
601 call assert_match('^"e \~.*Administrator', @:)
14135
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
602 endif
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
603 endif
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
604 endfunc
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
605
18977
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18924
diff changeset
606 func Test_cmdline_complete_bang()
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18924
diff changeset
607 if executable('whoami')
18981
25a60d11adc2 patch 8.2.0051: command line completion test skipped
Bram Moolenaar <Bram@vim.org>
parents: 18977
diff changeset
608 call feedkeys(":!whoam\<C-A>\<C-B>\"\<CR>", 'tx')
25a60d11adc2 patch 8.2.0051: command line completion test skipped
Bram Moolenaar <Bram@vim.org>
parents: 18977
diff changeset
609 call assert_match('^".*\<whoami\>', @:)
18977
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18924
diff changeset
610 endif
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18924
diff changeset
611 endfunc
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18924
diff changeset
612
14135
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
613 funct Test_cmdline_complete_languages()
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
614 let lang = substitute(execute('language messages'), '.*"\(.*\)"$', '\1', '')
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
615
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
616 call feedkeys(":language \<c-a>\<c-b>\"\<cr>", 'tx')
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
617 call assert_match('^"language .*\<ctype\>.*\<messages\>.*\<time\>', @:)
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
618
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
619 if has('unix')
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
620 " TODO: these tests don't work on Windows. lang appears to be 'C'
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
621 " but C does not appear in the completion. Why?
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
622 call assert_match('^"language .*\<' . lang . '\>', @:)
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
623
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
624 call feedkeys(":language messages \<c-a>\<c-b>\"\<cr>", 'tx')
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
625 call assert_match('^"language .*\<' . lang . '\>', @:)
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
626
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
627 call feedkeys(":language ctype \<c-a>\<c-b>\"\<cr>", 'tx')
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
628 call assert_match('^"language .*\<' . lang . '\>', @:)
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
629
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
630 call feedkeys(":language time \<c-a>\<c-b>\"\<cr>", 'tx')
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
631 call assert_match('^"language .*\<' . lang . '\>', @:)
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
632 endif
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
633 endfunc
ee649db58c41 patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents: 13998
diff changeset
634
18977
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18924
diff changeset
635 func Test_cmdline_complete_env_variable()
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18924
diff changeset
636 let $X_VIM_TEST_COMPLETE_ENV = 'foo'
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18924
diff changeset
637
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18924
diff changeset
638 call feedkeys(":edit $X_VIM_TEST_COMPLETE_E\<C-A>\<C-B>\"\<CR>", 'tx')
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18924
diff changeset
639 call assert_match('"edit $X_VIM_TEST_COMPLETE_ENV', @:)
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18924
diff changeset
640
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18924
diff changeset
641 unlet $X_VIM_TEST_COMPLETE_ENV
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18924
diff changeset
642 endfunc
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18924
diff changeset
643
12706
9b882316aa63 patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
644 func Test_cmdline_write_alternatefile()
9b882316aa63 patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
645 new
9b882316aa63 patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
646 call setline('.', ['one', 'two'])
9b882316aa63 patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
647 f foo.txt
9b882316aa63 patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
648 new
9b882316aa63 patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
649 f #-A
9b882316aa63 patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
650 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
651 f #<-B.txt
9b882316aa63 patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
652 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
653 f %<
9b882316aa63 patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
654 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
655 new
9b882316aa63 patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
656 call assert_fails('f #<', 'E95')
9b882316aa63 patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
657 bw!
9b882316aa63 patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
658 f foo-B.txt
9b882316aa63 patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
659 f %<-A
9b882316aa63 patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
660 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
661 bw!
9b882316aa63 patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
662 bw!
9b882316aa63 patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
663 endfunc
9b882316aa63 patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
664
10817
cc8079703414 patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents: 10694
diff changeset
665 " 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
666 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
667
cc8079703414 patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents: 10694
diff changeset
668 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
669 new
cc8079703414 patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents: 10694
diff changeset
670 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
671 /d
cc8079703414 patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents: 10694
diff changeset
672 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
673 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
674
cc8079703414 patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents: 10694
diff changeset
675 /a
cc8079703414 patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents: 10694
diff changeset
676 $
cc8079703414 patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents: 10694
diff changeset
677 \?,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
678 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
679
cc8079703414 patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents: 10694
diff changeset
680 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
681 %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
682 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
683 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
684
19407
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
685 let @/ = 'apple'
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
686 call assert_fails('\/print', 'E486:')
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
687
10817
cc8079703414 patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents: 10694
diff changeset
688 bwipe!
cc8079703414 patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents: 10694
diff changeset
689 endfunc
cc8079703414 patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents: 10694
diff changeset
690
19407
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
691 " Test for the tick mark (') in an excmd range
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
692 func Test_tick_mark_in_range()
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
693 " If only the tick is passed as a range and no command is specified, there
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
694 " should not be an error
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
695 call feedkeys(":'\<CR>", 'xt')
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
696 call assert_equal("'", getreg(':'))
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
697 call assert_fails("',print", 'E78:')
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
698 endfunc
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
699
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
700 " Test for using a line number followed by a search pattern as range
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
701 func Test_lnum_and_pattern_as_range()
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
702 new
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
703 call setline(1, ['foo 1', 'foo 2', 'foo 3'])
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
704 let @" = ''
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
705 2/foo/yank
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
706 call assert_equal("foo 3\n", @")
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
707 call assert_equal(1, line('.'))
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
708 close!
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
709 endfunc
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
710
10849
6ae12eba42b5 patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents: 10817
diff changeset
711 " 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
712 func Check_cmdline(cmdtype)
6ae12eba42b5 patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents: 10817
diff changeset
713 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
714 call assert_equal(8, getcmdpos())
6ae12eba42b5 patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents: 10817
diff changeset
715 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
716 return ''
6ae12eba42b5 patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents: 10817
diff changeset
717 endfunc
6ae12eba42b5 patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents: 10817
diff changeset
718
18043
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
719 set cpo&
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
720
10849
6ae12eba42b5 patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents: 10817
diff changeset
721 func Test_getcmdtype()
6ae12eba42b5 patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents: 10817
diff changeset
722 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
723
6ae12eba42b5 patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents: 10817
diff changeset
724 let cmdtype = ''
6ae12eba42b5 patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents: 10817
diff changeset
725 debuggreedy
6ae12eba42b5 patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents: 10817
diff changeset
726 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
727 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
728 call feedkeys("cont\<CR>", "xt")
6ae12eba42b5 patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents: 10817
diff changeset
729 0debuggreedy
6ae12eba42b5 patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents: 10817
diff changeset
730 call assert_equal('>', cmdtype)
6ae12eba42b5 patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents: 10817
diff changeset
731
6ae12eba42b5 patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents: 10817
diff changeset
732 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
733 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
734
6ae12eba42b5 patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents: 10817
diff changeset
735 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
736 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
737
6ae12eba42b5 patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents: 10817
diff changeset
738 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
739
6ae12eba42b5 patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents: 10817
diff changeset
740 cnoremap <expr> <F6> Check_cmdline('=')
6ae12eba42b5 patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents: 10817
diff changeset
741 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
742 cunmap <F6>
19517
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
743
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
744 call assert_equal('', getcmdline())
10849
6ae12eba42b5 patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents: 10817
diff changeset
745 endfunc
6ae12eba42b5 patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents: 10817
diff changeset
746
14167
3ca818b65cde patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents: 14135
diff changeset
747 func Test_getcmdwintype()
3ca818b65cde patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents: 14135
diff changeset
748 call feedkeys("q/:let a = getcmdwintype()\<CR>:q\<CR>", 'x!')
3ca818b65cde patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents: 14135
diff changeset
749 call assert_equal('/', a)
3ca818b65cde patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents: 14135
diff changeset
750
3ca818b65cde patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents: 14135
diff changeset
751 call feedkeys("q?:let a = getcmdwintype()\<CR>:q\<CR>", 'x!')
3ca818b65cde patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents: 14135
diff changeset
752 call assert_equal('?', a)
3ca818b65cde patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents: 14135
diff changeset
753
3ca818b65cde patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents: 14135
diff changeset
754 call feedkeys("q::let a = getcmdwintype()\<CR>:q\<CR>", 'x!')
3ca818b65cde patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents: 14135
diff changeset
755 call assert_equal(':', a)
3ca818b65cde patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents: 14135
diff changeset
756
3ca818b65cde patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents: 14135
diff changeset
757 call feedkeys(":\<C-F>:let a = getcmdwintype()\<CR>:q\<CR>", 'x!')
3ca818b65cde patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents: 14135
diff changeset
758 call assert_equal(':', a)
3ca818b65cde patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents: 14135
diff changeset
759
3ca818b65cde patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents: 14135
diff changeset
760 call assert_equal('', getcmdwintype())
3ca818b65cde patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents: 14135
diff changeset
761 endfunc
3ca818b65cde patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents: 14135
diff changeset
762
18043
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
763 func Test_getcmdwin_autocmd()
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
764 let s:seq = []
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
765 augroup CmdWin
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
766 au WinEnter * call add(s:seq, 'WinEnter ' .. win_getid())
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
767 au WinLeave * call add(s:seq, 'WinLeave ' .. win_getid())
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
768 au BufEnter * call add(s:seq, 'BufEnter ' .. bufnr())
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
769 au BufLeave * call add(s:seq, 'BufLeave ' .. bufnr())
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
770 au CmdWinEnter * call add(s:seq, 'CmdWinEnter ' .. win_getid())
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
771 au CmdWinLeave * call add(s:seq, 'CmdWinLeave ' .. win_getid())
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
772
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
773 let org_winid = win_getid()
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
774 let org_bufnr = bufnr()
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
775 call feedkeys("q::let a = getcmdwintype()\<CR>:let s:cmd_winid = win_getid()\<CR>:let s:cmd_bufnr = bufnr()\<CR>:q\<CR>", 'x!')
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
776 call assert_equal(':', a)
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
777 call assert_equal([
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
778 \ 'WinLeave ' .. org_winid,
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
779 \ 'WinEnter ' .. s:cmd_winid,
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
780 \ 'BufLeave ' .. org_bufnr,
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
781 \ 'BufEnter ' .. s:cmd_bufnr,
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
782 \ 'CmdWinEnter ' .. s:cmd_winid,
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
783 \ 'CmdWinLeave ' .. s:cmd_winid,
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
784 \ 'BufLeave ' .. s:cmd_bufnr,
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
785 \ 'WinLeave ' .. s:cmd_winid,
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
786 \ 'WinEnter ' .. org_winid,
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
787 \ 'BufEnter ' .. org_bufnr,
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
788 \ ], s:seq)
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
789
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
790 au!
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
791 augroup END
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
792 endfunc
5a0d5f8e1778 patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 17994
diff changeset
793
11323
3e799a37ea22 patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents: 11279
diff changeset
794 func Test_verbosefile()
3e799a37ea22 patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents: 11279
diff changeset
795 set verbosefile=Xlog
3e799a37ea22 patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents: 11279
diff changeset
796 echomsg 'foo'
3e799a37ea22 patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents: 11279
diff changeset
797 echomsg 'bar'
3e799a37ea22 patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents: 11279
diff changeset
798 set verbosefile=
3e799a37ea22 patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents: 11279
diff changeset
799 let log = readfile('Xlog')
3e799a37ea22 patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents: 11279
diff changeset
800 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
801 call delete('Xlog')
3e799a37ea22 patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents: 11279
diff changeset
802 endfunc
3e799a37ea22 patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents: 11279
diff changeset
803
18297
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
804 func Test_verbose_option()
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
805 CheckScreendump
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
806
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
807 let lines =<< trim [SCRIPT]
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
808 command DoSomething echo 'hello' |set ts=4 |let v = '123' |echo v
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
809 call feedkeys("\r", 't') " for the hit-enter prompt
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
810 set verbose=20
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
811 [SCRIPT]
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
812 call writefile(lines, 'XTest_verbose')
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
813
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
814 let buf = RunVimInTerminal('-S XTest_verbose', {'rows': 12})
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
815 call term_wait(buf, 100)
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
816 call term_sendkeys(buf, ":DoSomething\<CR>")
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
817 call VerifyScreenDump(buf, 'Test_verbose_option_1', {})
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
818
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
819 " clean up
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
820 call StopVimInTerminal(buf)
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
821 call delete('XTest_verbose')
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
822 endfunc
b0b37bd807ba patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents: 18084
diff changeset
823
13890
3aac8d62351c patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents: 13831
diff changeset
824 func Test_setcmdpos()
3aac8d62351c patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents: 13831
diff changeset
825 func InsertTextAtPos(text, pos)
3aac8d62351c patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents: 13831
diff changeset
826 call assert_equal(0, setcmdpos(a:pos))
3aac8d62351c patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents: 13831
diff changeset
827 return a:text
3aac8d62351c patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents: 13831
diff changeset
828 endfunc
3aac8d62351c patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents: 13831
diff changeset
829
3aac8d62351c patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents: 13831
diff changeset
830 " setcmdpos() with position in the middle of the command line.
3aac8d62351c patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents: 13831
diff changeset
831 call feedkeys(":\"12\<C-R>=InsertTextAtPos('a', 3)\<CR>b\<CR>", 'xt')
3aac8d62351c patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents: 13831
diff changeset
832 call assert_equal('"1ab2', @:)
3aac8d62351c patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents: 13831
diff changeset
833
3aac8d62351c patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents: 13831
diff changeset
834 call feedkeys(":\"12\<C-R>\<C-R>=InsertTextAtPos('a', 3)\<CR>b\<CR>", 'xt')
3aac8d62351c patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents: 13831
diff changeset
835 call assert_equal('"1b2a', @:)
3aac8d62351c patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents: 13831
diff changeset
836
3aac8d62351c patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents: 13831
diff changeset
837 " setcmdpos() with position beyond the end of the command line.
3aac8d62351c patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents: 13831
diff changeset
838 call feedkeys(":\"12\<C-B>\<C-R>=InsertTextAtPos('a', 10)\<CR>b\<CR>", 'xt')
3aac8d62351c patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents: 13831
diff changeset
839 call assert_equal('"12ab', @:)
3aac8d62351c patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents: 13831
diff changeset
840
3aac8d62351c patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents: 13831
diff changeset
841 " setcmdpos() returns 1 when not editing the command line.
17994
0dcc2ee838dd patch 8.1.1993: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17857
diff changeset
842 call assert_equal(1, 3->setcmdpos())
13890
3aac8d62351c patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents: 13831
diff changeset
843 endfunc
3aac8d62351c patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents: 13831
diff changeset
844
15320
de8dc397cd2a patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents: 14417
diff changeset
845 func Test_cmdline_overstrike()
15607
2dcaa860e3fc patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents: 15320
diff changeset
846 let encodings = ['latin1', 'utf8']
15320
de8dc397cd2a patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents: 14417
diff changeset
847 let encoding_save = &encoding
de8dc397cd2a patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents: 14417
diff changeset
848
de8dc397cd2a patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents: 14417
diff changeset
849 for e in encodings
de8dc397cd2a patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents: 14417
diff changeset
850 exe 'set encoding=' . e
de8dc397cd2a patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents: 14417
diff changeset
851
de8dc397cd2a patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents: 14417
diff changeset
852 " Test overstrike in the middle of the command line.
de8dc397cd2a patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents: 14417
diff changeset
853 call feedkeys(":\"01234\<home>\<right>\<right>ab\<right>\<insert>cd\<enter>", 'xt')
18924
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
854 call assert_equal('"0ab1cd4', @:, e)
15320
de8dc397cd2a patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents: 14417
diff changeset
855
de8dc397cd2a patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents: 14417
diff changeset
856 " Test overstrike going beyond end of command line.
de8dc397cd2a patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents: 14417
diff changeset
857 call feedkeys(":\"01234\<home>\<right>\<right>ab\<right>\<insert>cdefgh\<enter>", 'xt')
18924
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
858 call assert_equal('"0ab1cdefgh', @:, e)
15320
de8dc397cd2a patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents: 14417
diff changeset
859
de8dc397cd2a patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents: 14417
diff changeset
860 " Test toggling insert/overstrike a few times.
de8dc397cd2a patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents: 14417
diff changeset
861 call feedkeys(":\"01234\<home>\<right>ab\<right>\<insert>cd\<right>\<insert>ef\<enter>", 'xt')
18924
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
862 call assert_equal('"ab0cd3ef4', @:, e)
15320
de8dc397cd2a patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents: 14417
diff changeset
863 endfor
de8dc397cd2a patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents: 14417
diff changeset
864
15607
2dcaa860e3fc patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents: 15320
diff changeset
865 " Test overstrike with multi-byte characters.
2dcaa860e3fc patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents: 15320
diff changeset
866 call feedkeys(":\"テキストエディタ\<home>\<right>\<right>ab\<right>\<insert>cd\<enter>", 'xt')
18924
a18d7782b80f patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18804
diff changeset
867 call assert_equal('"テabキcdエディタ', @:, e)
15320
de8dc397cd2a patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents: 14417
diff changeset
868
de8dc397cd2a patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents: 14417
diff changeset
869 let &encoding = encoding_save
de8dc397cd2a patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents: 14417
diff changeset
870 endfunc
18084
f4b51934d4f8 patch 8.1.2037: can call win_gotoid() in cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 18043
diff changeset
871
f4b51934d4f8 patch 8.1.2037: can call win_gotoid() in cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 18043
diff changeset
872 func Test_cmdwin_bug()
f4b51934d4f8 patch 8.1.2037: can call win_gotoid() in cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 18043
diff changeset
873 let winid = win_getid()
f4b51934d4f8 patch 8.1.2037: can call win_gotoid() in cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 18043
diff changeset
874 sp
f4b51934d4f8 patch 8.1.2037: can call win_gotoid() in cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 18043
diff changeset
875 try
f4b51934d4f8 patch 8.1.2037: can call win_gotoid() in cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 18043
diff changeset
876 call feedkeys("q::call win_gotoid(" .. winid .. ")\<CR>:q\<CR>", 'x!')
f4b51934d4f8 patch 8.1.2037: can call win_gotoid() in cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 18043
diff changeset
877 catch /^Vim\%((\a\+)\)\=:E11/
f4b51934d4f8 patch 8.1.2037: can call win_gotoid() in cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 18043
diff changeset
878 endtry
f4b51934d4f8 patch 8.1.2037: can call win_gotoid() in cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 18043
diff changeset
879 bw!
f4b51934d4f8 patch 8.1.2037: can call win_gotoid() in cmdline window
Bram Moolenaar <Bram@vim.org>
parents: 18043
diff changeset
880 endfunc
18463
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
881
18467
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
882 func Test_cmdwin_restore()
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
883 CheckScreendump
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
884
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
885 let lines =<< trim [SCRIPT]
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
886 call setline(1, range(30))
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
887 2split
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
888 [SCRIPT]
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
889 call writefile(lines, 'XTest_restore')
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
890
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
891 let buf = RunVimInTerminal('-S XTest_restore', {'rows': 12})
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
892 call term_wait(buf, 100)
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
893 call term_sendkeys(buf, "q:")
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
894 call VerifyScreenDump(buf, 'Test_cmdwin_restore_1', {})
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
895
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
896 " normal restore
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
897 call term_sendkeys(buf, ":q\<CR>")
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
898 call VerifyScreenDump(buf, 'Test_cmdwin_restore_2', {})
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
899
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
900 " restore after setting 'lines' with one window
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
901 call term_sendkeys(buf, ":close\<CR>")
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
902 call term_sendkeys(buf, "q:")
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
903 call term_sendkeys(buf, ":set lines=18\<CR>")
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
904 call term_sendkeys(buf, ":q\<CR>")
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
905 call VerifyScreenDump(buf, 'Test_cmdwin_restore_3', {})
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
906
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
907 " clean up
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
908 call StopVimInTerminal(buf)
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
909 call delete('XTest_restore')
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
910 endfunc
99fc29219b3e patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents: 18463
diff changeset
911
18463
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
912 func Test_buffers_lastused()
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
913 " check that buffers are sorted by time when wildmode has lastused
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
914 call test_settime(1550020000) " middle
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
915 edit bufa
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
916 enew
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
917 call test_settime(1550030000) " newest
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
918 edit bufb
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
919 enew
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
920 call test_settime(1550010000) " oldest
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
921 edit bufc
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
922 enew
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
923 call test_settime(0)
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
924 enew
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
925
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
926 call assert_equal(['bufa', 'bufb', 'bufc'],
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
927 \ getcompletion('', 'buffer'))
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
928
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
929 let save_wildmode = &wildmode
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
930 set wildmode=full:lastused
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
931
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
932 let cap = "\<c-r>=execute('let X=getcmdline()')\<cr>"
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
933 call feedkeys(":b \<tab>" .. cap .. "\<esc>", 'xt')
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
934 call assert_equal('b bufb', X)
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
935 call feedkeys(":b \<tab>\<tab>" .. cap .. "\<esc>", 'xt')
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
936 call assert_equal('b bufa', X)
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
937 call feedkeys(":b \<tab>\<tab>\<tab>" .. cap .. "\<esc>", 'xt')
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
938 call assert_equal('b bufc', X)
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
939 enew
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
940
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
941 edit other
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
942 call feedkeys(":b \<tab>" .. cap .. "\<esc>", 'xt')
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
943 call assert_equal('b bufb', X)
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
944 call feedkeys(":b \<tab>\<tab>" .. cap .. "\<esc>", 'xt')
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
945 call assert_equal('b bufa', X)
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
946 call feedkeys(":b \<tab>\<tab>\<tab>" .. cap .. "\<esc>", 'xt')
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
947 call assert_equal('b bufc', X)
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
948 enew
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
949
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
950 let &wildmode = save_wildmode
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
951
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
952 bwipeout bufa
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
953 bwipeout bufb
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
954 bwipeout bufc
18d7337b6837 patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents: 18297
diff changeset
955 endfunc
18793
7a1606ceec7d patch 8.1.2385: opening cmdline window with feedkeys() does not work
Bram Moolenaar <Bram@vim.org>
parents: 18713
diff changeset
956
7a1606ceec7d patch 8.1.2385: opening cmdline window with feedkeys() does not work
Bram Moolenaar <Bram@vim.org>
parents: 18713
diff changeset
957 func Test_cmdwin_feedkeys()
7a1606ceec7d patch 8.1.2385: opening cmdline window with feedkeys() does not work
Bram Moolenaar <Bram@vim.org>
parents: 18713
diff changeset
958 " This should not generate E488
7a1606ceec7d patch 8.1.2385: opening cmdline window with feedkeys() does not work
Bram Moolenaar <Bram@vim.org>
parents: 18713
diff changeset
959 call feedkeys("q:\<CR>", 'x')
7a1606ceec7d patch 8.1.2385: opening cmdline window with feedkeys() does not work
Bram Moolenaar <Bram@vim.org>
parents: 18713
diff changeset
960 endfunc
18804
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
961
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
962 " Tests for the issues fixed in 7.4.441.
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
963 " When 'cedit' is set to Ctrl-C, opening the command window hangs Vim
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
964 func Test_cmdwin_cedit()
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
965 exe "set cedit=\<C-c>"
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
966 normal! :
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
967 call assert_equal(1, winnr('$'))
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
968
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
969 let g:cmd_wintype = ''
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
970 func CmdWinType()
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
971 let g:cmd_wintype = getcmdwintype()
19398
f0033a10b613 patch 8.2.0257: cannot recognize a terminal in a popup window
Bram Moolenaar <Bram@vim.org>
parents: 19370
diff changeset
972 let g:wintype = win_gettype()
18804
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
973 return ''
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
974 endfunc
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
975
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
976 call feedkeys("\<C-c>a\<C-R>=CmdWinType()\<CR>\<CR>")
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
977 echo input('')
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
978 call assert_equal('@', g:cmd_wintype)
19398
f0033a10b613 patch 8.2.0257: cannot recognize a terminal in a popup window
Bram Moolenaar <Bram@vim.org>
parents: 19370
diff changeset
979 call assert_equal('command', g:wintype)
18804
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
980
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
981 set cedit&vim
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
982 delfunc CmdWinType
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
983 endfunc
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
984
19517
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
985 " Test for CmdwinEnter autocmd
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
986 func Test_cmdwin_autocmd()
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
987 augroup CmdWin
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
988 au!
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
989 autocmd CmdwinEnter * startinsert
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
990 augroup END
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
991
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
992 call assert_fails('call feedkeys("q:xyz\<CR>", "xt")', 'E492:')
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
993 call assert_equal('xyz', @:)
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
994
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
995 augroup CmdWin
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
996 au!
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
997 augroup END
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
998 augroup! CmdWin
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
999 endfunc
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
1000
19143
bfcafd1a3e37 patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents: 18981
diff changeset
1001 func Test_cmdlineclear_tabenter()
bfcafd1a3e37 patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents: 18981
diff changeset
1002 CheckScreendump
bfcafd1a3e37 patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents: 18981
diff changeset
1003
bfcafd1a3e37 patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents: 18981
diff changeset
1004 let lines =<< trim [SCRIPT]
bfcafd1a3e37 patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents: 18981
diff changeset
1005 call setline(1, range(30))
bfcafd1a3e37 patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents: 18981
diff changeset
1006 [SCRIPT]
bfcafd1a3e37 patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents: 18981
diff changeset
1007
bfcafd1a3e37 patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents: 18981
diff changeset
1008 call writefile(lines, 'XtestCmdlineClearTabenter')
bfcafd1a3e37 patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents: 18981
diff changeset
1009 let buf = RunVimInTerminal('-S XtestCmdlineClearTabenter', #{rows: 10})
bfcafd1a3e37 patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents: 18981
diff changeset
1010 call term_wait(buf, 50)
bfcafd1a3e37 patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents: 18981
diff changeset
1011 " in one tab make the command line higher with CTRL-W -
bfcafd1a3e37 patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents: 18981
diff changeset
1012 call term_sendkeys(buf, ":tabnew\<cr>\<C-w>-\<C-w>-gtgt")
bfcafd1a3e37 patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents: 18981
diff changeset
1013 call VerifyScreenDump(buf, 'Test_cmdlineclear_tabenter', {})
bfcafd1a3e37 patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents: 18981
diff changeset
1014
bfcafd1a3e37 patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents: 18981
diff changeset
1015 call StopVimInTerminal(buf)
bfcafd1a3e37 patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents: 18981
diff changeset
1016 call delete('XtestCmdlineClearTabenter')
bfcafd1a3e37 patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents: 18981
diff changeset
1017 endfunc
bfcafd1a3e37 patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents: 18981
diff changeset
1018
19370
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19143
diff changeset
1019 " Test for failure in expanding special keywords in cmdline
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19143
diff changeset
1020 func Test_cmdline_expand_special()
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19143
diff changeset
1021 %bwipe!
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19143
diff changeset
1022 call assert_fails('e #', 'E499:')
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19143
diff changeset
1023 call assert_fails('e <afile>', 'E495:')
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19143
diff changeset
1024 call assert_fails('e <abuf>', 'E496:')
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19143
diff changeset
1025 call assert_fails('e <amatch>', 'E497:')
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19143
diff changeset
1026 endfunc
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19143
diff changeset
1027
19407
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
1028 func Test_cmdwin_jump_to_win()
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
1029 call assert_fails('call feedkeys("q:\<C-W>\<C-W>\<CR>", "xt")', 'E11:')
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
1030 new
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
1031 set modified
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
1032 call assert_fails('call feedkeys("q/:qall\<CR>", "xt")', 'E162:')
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
1033 close!
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
1034 call feedkeys("q/:close\<CR>", "xt")
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
1035 call assert_equal(1, winnr('$'))
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
1036 call feedkeys("q/:exit\<CR>", "xt")
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
1037 call assert_equal(1, winnr('$'))
19517
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
1038
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
1039 " opening command window twice should fail
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
1040 call assert_beeps('call feedkeys("q:q:\<CR>\<CR>", "xt")')
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
1041 call assert_equal(1, winnr('$'))
19407
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
1042 endfunc
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
1043
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
1044 " Test for backtick expression in the command line
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
1045 func Test_cmd_backtick()
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
1046 %argd
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
1047 argadd `=['a', 'b', 'c']`
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
1048 call assert_equal(['a', 'b', 'c'], argv())
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
1049 %argd
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
1050 endfunc
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19398
diff changeset
1051
19471
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1052 " Test for the :! command
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1053 func Test_cmd_bang()
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1054 if !has('unix')
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1055 return
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1056 endif
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1057
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1058 let lines =<< trim [SCRIPT]
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1059 " Test for no previous command
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1060 call assert_fails('!!', 'E34:')
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1061 set nomore
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1062 " Test for cmdline expansion with :!
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1063 call setline(1, 'foo!')
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1064 silent !echo <cWORD> > Xfile.out
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1065 call assert_equal(['foo!'], readfile('Xfile.out'))
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1066 " Test for using previous command
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1067 silent !echo \! !
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1068 call assert_equal(['! echo foo!'], readfile('Xfile.out'))
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1069 call writefile(v:errors, 'Xresult')
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1070 call delete('Xfile.out')
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1071 qall!
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1072 [SCRIPT]
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1073 call writefile(lines, 'Xscript')
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1074 if RunVim([], [], '--clean -S Xscript')
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1075 call assert_equal([], readfile('Xresult'))
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1076 endif
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1077 call delete('Xscript')
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1078 call delete('Xresult')
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1079 endfunc
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
1080
19517
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
1081 " Test for using ~ for home directory in cmdline completion matches
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
1082 func Test_cmdline_expand_home()
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
1083 call mkdir('Xdir')
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
1084 call writefile([], 'Xdir/Xfile1')
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
1085 call writefile([], 'Xdir/Xfile2')
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
1086 cd Xdir
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
1087 let save_HOME = $HOME
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
1088 let $HOME = getcwd()
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
1089 call feedkeys(":e ~/\<C-A>\<C-B>\"\<CR>", 'xt')
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
1090 call assert_equal('"e ~/Xfile1 ~/Xfile2', @:)
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
1091 let $HOME = save_HOME
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
1092 cd ..
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
1093 call delete('Xdir', 'rf')
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
1094 endfunc
738a4fe2c8c5 patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
1095
19536
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1096 " Test for using CTRL-\ CTRL-G in the command line to go back to normal mode
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1097 " or insert mode (when 'insertmode' is set)
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1098 func Test_cmdline_ctrl_g()
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1099 new
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1100 call setline(1, 'abc')
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1101 call cursor(1, 3)
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1102 " If command line is entered from insert mode, using C-\ C-G should back to
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1103 " insert mode
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1104 call feedkeys("i\<C-O>:\<C-\>\<C-G>xy", 'xt')
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1105 call assert_equal('abxyc', getline(1))
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1106 call assert_equal(4, col('.'))
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1107
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1108 " If command line is entered in 'insertmode', using C-\ C-G should back to
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1109 " 'insertmode'
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1110 call feedkeys(":set im\<cr>\<C-L>:\<C-\>\<C-G>12\<C-L>:set noim\<cr>", 'xt')
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1111 call assert_equal('ab12xyc', getline(1))
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1112 close!
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1113 endfunc
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1114
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1115 " Return the 'len' characters in screen starting from (row,col)
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1116 func s:ScreenLine(row, col, len)
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1117 let s = ''
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1118 for i in range(a:len)
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1119 let s .= nr2char(screenchar(a:row, a:col + i))
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1120 endfor
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1121 return s
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1122 endfunc
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1123
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1124 " Test for 'wildmode'
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1125 func Test_wildmode()
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1126 func T(a, c, p)
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1127 return "oneA\noneB\noneC"
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1128 endfunc
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1129 command -nargs=1 -complete=custom,T MyCmd
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1130
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1131 func SaveScreenLine()
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1132 let g:Sline = s:ScreenLine(&lines - 1, 1, 20)
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1133 return ''
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1134 endfunc
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1135 cnoremap <expr> <F2> SaveScreenLine()
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1136
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1137 set nowildmenu
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1138 set wildmode=full,list
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1139 let g:Sline = ''
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1140 call feedkeys(":MyCmd \t\t\<F2>\<C-B>\"\<CR>", 'xt')
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1141 call assert_equal('oneA oneB oneC ', g:Sline)
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1142 call assert_equal('"MyCmd oneA', @:)
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1143
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1144 set wildmode=longest,full
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1145 call feedkeys(":MyCmd o\t\<C-B>\"\<CR>", 'xt')
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1146 call assert_equal('"MyCmd one', @:)
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1147 call feedkeys(":MyCmd o\t\t\t\t\<C-B>\"\<CR>", 'xt')
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1148 call assert_equal('"MyCmd oneC', @:)
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1149
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1150 set wildmode=longest
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1151 call feedkeys(":MyCmd one\t\t\<C-B>\"\<CR>", 'xt')
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1152 call assert_equal('"MyCmd one', @:)
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1153
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1154 set wildmode=list:longest
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1155 let g:Sline = ''
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1156 call feedkeys(":MyCmd \t\<F2>\<C-B>\"\<CR>", 'xt')
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1157 call assert_equal('oneA oneB oneC ', g:Sline)
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1158 call assert_equal('"MyCmd one', @:)
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1159
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1160 set wildmode=""
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1161 call feedkeys(":MyCmd \t\t\<C-B>\"\<CR>", 'xt')
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1162 call assert_equal('"MyCmd oneA', @:)
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1163
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1164 delcommand MyCmd
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1165 delfunc T
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1166 delfunc SaveScreenLine
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1167 cunmap <F2>
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1168 set wildmode&
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1169 endfunc
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1170
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1171 " Test for interrupting the command-line completion
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1172 func Test_interrupt_compl()
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1173 func F(lead, cmdl, p)
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1174 if a:lead =~ 'tw'
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1175 call interrupt()
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1176 return
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1177 endif
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1178 return "one\ntwo\nthree"
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1179 endfunc
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1180 command -nargs=1 -complete=custom,F Tcmd
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1181
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1182 set nowildmenu
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1183 set wildmode=full
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1184 let interrupted = 0
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1185 try
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1186 call feedkeys(":Tcmd tw\<Tab>\<C-B>\"\<CR>", 'xt')
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1187 catch /^Vim:Interrupt$/
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1188 let interrupted = 1
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1189 endtry
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1190 call assert_equal(1, interrupted)
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1191
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1192 delcommand Tcmd
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1193 delfunc F
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1194 set wildmode&
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1195 endfunc
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1196
19550
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1197 " Test for moving the cursor on the : command line
19536
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1198 func Test_cmdline_edit()
19550
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1199 let str = ":one two\<C-U>"
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1200 let str ..= "one two\<C-W>\<C-W>"
19581
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1201 let str ..= "four\<BS>\<C-H>\<Del>\<kDel>"
19550
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1202 let str ..= "\<Left>five\<Right>"
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1203 let str ..= "\<Home>two "
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1204 let str ..= "\<C-Left>one "
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1205 let str ..= "\<C-Right> three"
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1206 let str ..= "\<End>\<S-Left>four "
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1207 let str ..= "\<S-Right> six"
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1208 let str ..= "\<C-B>\"\<C-E> seven\<CR>"
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1209 call feedkeys(str, 'xt')
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1210 call assert_equal("\"one two three four five six seven", @:)
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1211 endfunc
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1212
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1213 " Test for moving the cursor on the / command line in 'rightleft' mode
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1214 func Test_cmdline_edit_rightleft()
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1215 CheckFeature rightleft
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1216 set rightleft
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1217 set rightleftcmd=search
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1218 let str = "/one two\<C-U>"
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1219 let str ..= "one two\<C-W>\<C-W>"
19581
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1220 let str ..= "four\<BS>\<C-H>\<Del>\<kDel>"
19550
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1221 let str ..= "\<Right>five\<Left>"
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1222 let str ..= "\<Home>two "
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1223 let str ..= "\<C-Right>one "
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1224 let str ..= "\<C-Left> three"
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1225 let str ..= "\<End>\<S-Right>four "
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1226 let str ..= "\<S-Left> six"
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1227 let str ..= "\<C-B>\"\<C-E> seven\<CR>"
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1228 call assert_fails("call feedkeys(str, 'xt')", 'E486:')
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1229 call assert_equal("\"one two three four five six seven", @/)
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1230 set rightleftcmd&
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1231 set rightleft&
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1232 endfunc
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1233
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1234 " Test for using <C-\>e in the command line to evaluate an expression
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1235 func Test_cmdline_expr()
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1236 " Evaluate an expression from the beginning of a command line
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1237 call feedkeys(":abc\<C-B>\<C-\>e\"\\\"hello\"\<CR>\<CR>", 'xt')
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1238 call assert_equal('"hello', @:)
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1239
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1240 " Use an invalid expression for <C-\>e
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1241 call assert_beeps('call feedkeys(":\<C-\>einvalid\<CR>", "tx")')
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1242
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1243 " Insert literal <CTRL-\> in the command line
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1244 call feedkeys(":\"e \<C-\>\<C-Y>\<CR>", 'xt')
b3ef3538b389 patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1245 call assert_equal("\"e \<C-\>\<C-Y>", @:)
19536
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1246 endfunc
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19517
diff changeset
1247
19570
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1248 " Test for 'imcmdline' and 'imsearch'
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1249 " This test doesn't actually test the input method functionality.
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1250 func Test_cmdline_inputmethod()
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1251 new
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1252 call setline(1, ['', 'abc', ''])
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1253 set imcmdline
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1254
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1255 call feedkeys(":\"abc\<CR>", 'xt')
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1256 call assert_equal("\"abc", @:)
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1257 call feedkeys(":\"\<C-^>abc\<C-^>\<CR>", 'xt')
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1258 call assert_equal("\"abc", @:)
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1259 call feedkeys("/abc\<CR>", 'xt')
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1260 call assert_equal([2, 1], [line('.'), col('.')])
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1261 call feedkeys("/\<C-^>abc\<C-^>\<CR>", 'xt')
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1262 call assert_equal([2, 1], [line('.'), col('.')])
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1263
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1264 set imsearch=2
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1265 call cursor(1, 1)
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1266 call feedkeys("/abc\<CR>", 'xt')
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1267 call assert_equal([2, 1], [line('.'), col('.')])
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1268 call cursor(1, 1)
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1269 call feedkeys("/\<C-^>abc\<C-^>\<CR>", 'xt')
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1270 call assert_equal([2, 1], [line('.'), col('.')])
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1271 set imdisable
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1272 call feedkeys("/\<C-^>abc\<C-^>\<CR>", 'xt')
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1273 call assert_equal([2, 1], [line('.'), col('.')])
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1274 set imdisable&
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1275 set imsearch&
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1276
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1277 set imcmdline&
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1278 %bwipe!
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1279 endfunc
43c04edcafec patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19556
diff changeset
1280
19581
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1281 " Test for opening the command-line window when too many windows are present
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1282 func Test_cmdwin_fail_to_open()
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1283 " Open as many windows as possible
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1284 for i in range(100)
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1285 try
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1286 new
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1287 catch /E36:/
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1288 break
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1289 endtry
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1290 endfor
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1291 call assert_beeps('call feedkeys("q:\<CR>", "xt")')
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1292 only
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1293 endfunc
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1294
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1295 " Test for recursively getting multiple command line inputs
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1296 func Test_cmdwin_multi_input()
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1297 call feedkeys(":\<C-R>=input('P: ')\<CR>\"cyan\<CR>\<CR>", 'xt')
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1298 call assert_equal('"cyan', @:)
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1299 endfunc
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1300
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1301 " Test for using CTRL-_ in the command line with 'allowrevins'
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1302 func Test_cmdline_revins()
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1303 CheckNotMSWindows
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1304 CheckFeature rightleft
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1305 call feedkeys(":\"abc\<c-_>\<cr>", 'xt')
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1306 call assert_equal("\"abc\<c-_>", @:)
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1307 set allowrevins
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1308 call feedkeys(":\"abc\<c-_>xyz\<c-_>\<CR>", 'xt')
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1309 call assert_equal('"abcñèæ', @:)
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1310 set allowrevins&
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1311 endfunc
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1312
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1313 " Test for typing UTF-8 composing characters in the command line
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1314 func Test_cmdline_composing_chars()
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1315 call feedkeys(":\"\<C-V>u3046\<C-V>u3099\<CR>", 'xt')
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1316 call assert_equal('"ゔ', @:)
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1317 endfunc
848dc460adf0 patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19570
diff changeset
1318
19613
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 19581
diff changeset
1319 " Test for normal mode commands not supported in the cmd window
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 19581
diff changeset
1320 func Test_cmdwin_blocked_commands()
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 19581
diff changeset
1321 call assert_fails('call feedkeys("q:\<C-T>\<CR>", "xt")', 'E11:')
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 19581
diff changeset
1322 call assert_fails('call feedkeys("q:\<C-]>\<CR>", "xt")', 'E11:')
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 19581
diff changeset
1323 call assert_fails('call feedkeys("q:\<C-^>\<CR>", "xt")', 'E11:')
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 19581
diff changeset
1324 call assert_fails('call feedkeys("q:Q\<CR>", "xt")', 'E11:')
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 19581
diff changeset
1325 call assert_fails('call feedkeys("q:Z\<CR>", "xt")', 'E11:')
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 19581
diff changeset
1326 call assert_fails('call feedkeys("q:\<F1>\<CR>", "xt")', 'E11:')
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 19581
diff changeset
1327 endfunc
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 19581
diff changeset
1328
18804
2d41b63f52de patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents: 18793
diff changeset
1329 " vim: shiftwidth=2 sts=2 expandtab