annotate src/testdir/test_help.vim @ 18977:5bef1043abff v8.2.0049

patch 8.2.0049: command line completion not fully tested Commit: https://github.com/vim/vim/commit/297610ba4b110c918ffe60c45eb4a1d6ea2daae5 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 27 17:20:55 2019 +0100 patch 8.2.0049: command line completion not fully tested Problem: Command line completion not fully tested. Solution: Add more test cases. Make help sorting stable. (Dominique Pelle, closes #5402)
author Bram Moolenaar <Bram@vim.org>
date Fri, 27 Dec 2019 17:30:03 +0100
parents d0dfb3b0fe31
children 1b02482e6a61
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10883
cb71a5468aca patch 8.0.0331: restoring help snapshot accesses freed memory
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Tests for :help
cb71a5468aca patch 8.0.0331: restoring help snapshot accesses freed memory
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
cb71a5468aca patch 8.0.0331: restoring help snapshot accesses freed memory
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 func Test_help_restore_snapshot()
cb71a5468aca patch 8.0.0331: restoring help snapshot accesses freed memory
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 help
cb71a5468aca patch 8.0.0331: restoring help snapshot accesses freed memory
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 set buftype=
cb71a5468aca patch 8.0.0331: restoring help snapshot accesses freed memory
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 help
cb71a5468aca patch 8.0.0331: restoring help snapshot accesses freed memory
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 edit x
cb71a5468aca patch 8.0.0331: restoring help snapshot accesses freed memory
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 help
cb71a5468aca patch 8.0.0331: restoring help snapshot accesses freed memory
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 helpclose
cb71a5468aca patch 8.0.0331: restoring help snapshot accesses freed memory
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 endfunc
11167
260100346566 patch 8.0.0470: not enough testing for help commands
Christian Brabandt <cb@256bit.org>
parents: 10883
diff changeset
11
260100346566 patch 8.0.0470: not enough testing for help commands
Christian Brabandt <cb@256bit.org>
parents: 10883
diff changeset
12 func Test_help_errors()
260100346566 patch 8.0.0470: not enough testing for help commands
Christian Brabandt <cb@256bit.org>
parents: 10883
diff changeset
13 call assert_fails('help doesnotexist', 'E149:')
260100346566 patch 8.0.0470: not enough testing for help commands
Christian Brabandt <cb@256bit.org>
parents: 10883
diff changeset
14 call assert_fails('help!', 'E478:')
12236
55cf556d8ce1 patch 8.0.0998: strange error when using K while only spaces are selected
Christian Brabandt <cb@256bit.org>
parents: 11167
diff changeset
15
55cf556d8ce1 patch 8.0.0998: strange error when using K while only spaces are selected
Christian Brabandt <cb@256bit.org>
parents: 11167
diff changeset
16 new
55cf556d8ce1 patch 8.0.0998: strange error when using K while only spaces are selected
Christian Brabandt <cb@256bit.org>
parents: 11167
diff changeset
17 set keywordprg=:help
55cf556d8ce1 patch 8.0.0998: strange error when using K while only spaces are selected
Christian Brabandt <cb@256bit.org>
parents: 11167
diff changeset
18 call setline(1, " ")
55cf556d8ce1 patch 8.0.0998: strange error when using K while only spaces are selected
Christian Brabandt <cb@256bit.org>
parents: 11167
diff changeset
19 call assert_fails('normal VK', 'E349:')
55cf556d8ce1 patch 8.0.0998: strange error when using K while only spaces are selected
Christian Brabandt <cb@256bit.org>
parents: 11167
diff changeset
20 bwipe!
11167
260100346566 patch 8.0.0470: not enough testing for help commands
Christian Brabandt <cb@256bit.org>
parents: 10883
diff changeset
21 endfunc
12236
55cf556d8ce1 patch 8.0.0998: strange error when using K while only spaces are selected
Christian Brabandt <cb@256bit.org>
parents: 11167
diff changeset
22
18237
d0dfb3b0fe31 patch 8.1.2113: ":help expr-!~?" only works after searching
Bram Moolenaar <Bram@vim.org>
parents: 13014
diff changeset
23 func Test_help_expr()
d0dfb3b0fe31 patch 8.1.2113: ":help expr-!~?" only works after searching
Bram Moolenaar <Bram@vim.org>
parents: 13014
diff changeset
24 help expr-!~?
d0dfb3b0fe31 patch 8.1.2113: ":help expr-!~?" only works after searching
Bram Moolenaar <Bram@vim.org>
parents: 13014
diff changeset
25 call assert_equal('eval.txt', expand('%:t'))
d0dfb3b0fe31 patch 8.1.2113: ":help expr-!~?" only works after searching
Bram Moolenaar <Bram@vim.org>
parents: 13014
diff changeset
26 close
d0dfb3b0fe31 patch 8.1.2113: ":help expr-!~?" only works after searching
Bram Moolenaar <Bram@vim.org>
parents: 13014
diff changeset
27 endfunc
d0dfb3b0fe31 patch 8.1.2113: ":help expr-!~?" only works after searching
Bram Moolenaar <Bram@vim.org>
parents: 13014
diff changeset
28
12236
55cf556d8ce1 patch 8.0.0998: strange error when using K while only spaces are selected
Christian Brabandt <cb@256bit.org>
parents: 11167
diff changeset
29 func Test_help_keyword()
55cf556d8ce1 patch 8.0.0998: strange error when using K while only spaces are selected
Christian Brabandt <cb@256bit.org>
parents: 11167
diff changeset
30 new
55cf556d8ce1 patch 8.0.0998: strange error when using K while only spaces are selected
Christian Brabandt <cb@256bit.org>
parents: 11167
diff changeset
31 set keywordprg=:help
55cf556d8ce1 patch 8.0.0998: strange error when using K while only spaces are selected
Christian Brabandt <cb@256bit.org>
parents: 11167
diff changeset
32 call setline(1, " Visual ")
55cf556d8ce1 patch 8.0.0998: strange error when using K while only spaces are selected
Christian Brabandt <cb@256bit.org>
parents: 11167
diff changeset
33 normal VK
55cf556d8ce1 patch 8.0.0998: strange error when using K while only spaces are selected
Christian Brabandt <cb@256bit.org>
parents: 11167
diff changeset
34 call assert_match('^Visual mode', getline('.'))
55cf556d8ce1 patch 8.0.0998: strange error when using K while only spaces are selected
Christian Brabandt <cb@256bit.org>
parents: 11167
diff changeset
35 call assert_equal('help', &ft)
55cf556d8ce1 patch 8.0.0998: strange error when using K while only spaces are selected
Christian Brabandt <cb@256bit.org>
parents: 11167
diff changeset
36 close
55cf556d8ce1 patch 8.0.0998: strange error when using K while only spaces are selected
Christian Brabandt <cb@256bit.org>
parents: 11167
diff changeset
37 bwipe!
55cf556d8ce1 patch 8.0.0998: strange error when using K while only spaces are selected
Christian Brabandt <cb@256bit.org>
parents: 11167
diff changeset
38 endfunc
13014
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
39
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
40 func Test_help_local_additions()
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
41 call mkdir('Xruntime/doc', 'p')
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
42 call writefile(['*mydoc.txt* my awesome doc'], 'Xruntime/doc/mydoc.txt')
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
43 call writefile(['*mydoc-ext.txt* my extended awesome doc'], 'Xruntime/doc/mydoc-ext.txt')
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
44 let rtp_save = &rtp
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
45 set rtp+=./Xruntime
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
46 help
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
47 1
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
48 call search('mydoc.txt')
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
49 call assert_equal('|mydoc.txt| my awesome doc', getline('.'))
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
50 1
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
51 call search('mydoc-ext.txt')
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
52 call assert_equal('|mydoc-ext.txt| my extended awesome doc', getline('.'))
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
53 close
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
54
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
55 call delete('Xruntime', 'rf')
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
56 let &rtp = rtp_save
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
57 endfunc
18977
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18237
diff changeset
58
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18237
diff changeset
59 func Test_help_completion()
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18237
diff changeset
60 call feedkeys(":help :undo\<C-A>\<C-B>\"\<CR>", 'tx')
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18237
diff changeset
61 call assert_equal('"help :undo :undoj :undol :undojoin :undolist', @:)
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18237
diff changeset
62 endfunc