Mercurial > vim
annotate src/testdir/test_help.vim @ 26433:6d49ab05b0e9
Added tag v8.2.3747 for changeset 99a512bd84239ddf85d5dbe284706356d5489286
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 05 Dec 2021 19:00:04 +0100 |
parents | 35d000f3d591 |
children | e3f3108a780a |
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 |
24164
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
3 source check.vim |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
4 |
10883
cb71a5468aca
patch 8.0.0331: restoring help snapshot accesses freed memory
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 func Test_help_restore_snapshot() |
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 set buftype= |
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 edit x |
cb71a5468aca
patch 8.0.0331: restoring help snapshot accesses freed memory
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 help |
cb71a5468aca
patch 8.0.0331: restoring help snapshot accesses freed memory
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 helpclose |
cb71a5468aca
patch 8.0.0331: restoring help snapshot accesses freed memory
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 endfunc |
11167
260100346566
patch 8.0.0470: not enough testing for help commands
Christian Brabandt <cb@256bit.org>
parents:
10883
diff
changeset
|
13 |
260100346566
patch 8.0.0470: not enough testing for help commands
Christian Brabandt <cb@256bit.org>
parents:
10883
diff
changeset
|
14 func Test_help_errors() |
260100346566
patch 8.0.0470: not enough testing for help commands
Christian Brabandt <cb@256bit.org>
parents:
10883
diff
changeset
|
15 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
|
16 call assert_fails('help!', 'E478:') |
19277
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18977
diff
changeset
|
17 if has('multi_lang') |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18977
diff
changeset
|
18 call assert_fails('help help@xy', 'E661:') |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18977
diff
changeset
|
19 endif |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18977
diff
changeset
|
20 |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18977
diff
changeset
|
21 let save_hf = &helpfile |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18977
diff
changeset
|
22 set helpfile=help_missing |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18977
diff
changeset
|
23 help |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18977
diff
changeset
|
24 call assert_equal(1, winnr('$')) |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18977
diff
changeset
|
25 call assert_notequal('help', &buftype) |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18977
diff
changeset
|
26 let &helpfile = save_hf |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18977
diff
changeset
|
27 |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18977
diff
changeset
|
28 call assert_fails('help ' . repeat('a', 1048), 'E149:') |
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 |
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, " ") |
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 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
|
34 bwipe! |
11167
260100346566
patch 8.0.0470: not enough testing for help commands
Christian Brabandt <cb@256bit.org>
parents:
10883
diff
changeset
|
35 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
|
36 |
18237
d0dfb3b0fe31
patch 8.1.2113: ":help expr-!~?" only works after searching
Bram Moolenaar <Bram@vim.org>
parents:
13014
diff
changeset
|
37 func Test_help_expr() |
d0dfb3b0fe31
patch 8.1.2113: ":help expr-!~?" only works after searching
Bram Moolenaar <Bram@vim.org>
parents:
13014
diff
changeset
|
38 help expr-!~? |
d0dfb3b0fe31
patch 8.1.2113: ":help expr-!~?" only works after searching
Bram Moolenaar <Bram@vim.org>
parents:
13014
diff
changeset
|
39 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
|
40 close |
d0dfb3b0fe31
patch 8.1.2113: ":help expr-!~?" only works after searching
Bram Moolenaar <Bram@vim.org>
parents:
13014
diff
changeset
|
41 endfunc |
d0dfb3b0fe31
patch 8.1.2113: ":help expr-!~?" only works after searching
Bram Moolenaar <Bram@vim.org>
parents:
13014
diff
changeset
|
42 |
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
|
43 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
|
44 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
|
45 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
|
46 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
|
47 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
|
48 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
|
49 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
|
50 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
|
51 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
|
52 endfunc |
13014
e1deb00ffc27
patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents:
12236
diff
changeset
|
53 |
e1deb00ffc27
patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents:
12236
diff
changeset
|
54 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
|
55 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
|
56 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
|
57 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
|
58 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
|
59 set rtp+=./Xruntime |
e1deb00ffc27
patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents:
12236
diff
changeset
|
60 help |
e1deb00ffc27
patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents:
12236
diff
changeset
|
61 1 |
e1deb00ffc27
patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents:
12236
diff
changeset
|
62 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
|
63 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
|
64 1 |
e1deb00ffc27
patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents:
12236
diff
changeset
|
65 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
|
66 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
|
67 close |
e1deb00ffc27
patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents:
12236
diff
changeset
|
68 |
e1deb00ffc27
patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents:
12236
diff
changeset
|
69 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
|
70 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
|
71 endfunc |
18977
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18237
diff
changeset
|
72 |
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18237
diff
changeset
|
73 func Test_help_completion() |
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18237
diff
changeset
|
74 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
|
75 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
|
76 endfunc |
19289
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
77 |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
78 " Test for the :helptags command |
24057
eeb5518a37aa
patch 8.2.2570: tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
19429
diff
changeset
|
79 " NOTE: if you run tests as root this will fail. Don't run tests as root! |
19289
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
80 func Test_helptag_cmd() |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
81 call mkdir('Xdir/a/doc', 'p') |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
82 |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
83 " No help file to process in the directory |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
84 call assert_fails('helptags Xdir', 'E151:') |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
85 |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
86 call writefile([], 'Xdir/a/doc/sample.txt') |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
87 |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
88 " Test for ++t argument |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
89 helptags ++t Xdir |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
90 call assert_equal(["help-tags\ttags\t1"], readfile('Xdir/tags')) |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
91 call delete('Xdir/tags') |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
92 |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
93 " Duplicate tags in the help file |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
94 call writefile(['*tag1*', '*tag1*', '*tag2*'], 'Xdir/a/doc/sample.txt') |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
95 call assert_fails('helptags Xdir', 'E154:') |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
96 |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
97 call delete('Xdir', 'rf') |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
98 endfunc |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
99 |
24164
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
100 func Test_helptag_cmd_readonly() |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
101 CheckUnix |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
102 CheckNotRoot |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
103 |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
104 " Read-only tags file |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
105 call mkdir('Xdir/doc', 'p') |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
106 call writefile([''], 'Xdir/doc/tags') |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
107 call writefile([], 'Xdir/doc/sample.txt') |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
108 call setfperm('Xdir/doc/tags', 'r-xr--r--') |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
109 call assert_fails('helptags Xdir/doc', 'E152:', getfperm('Xdir/doc/tags')) |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
110 |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
111 let rtp = &rtp |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
112 let &rtp = 'Xdir' |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
113 helptags ALL |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
114 let &rtp = rtp |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
115 |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
116 call delete('Xdir/doc/tags') |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
117 |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
118 " No permission to read the help file |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
119 call mkdir('Xdir/b/doc', 'p') |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
120 call writefile([], 'Xdir/b/doc/sample.txt') |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
121 call setfperm('Xdir/b/doc/sample.txt', '-w-------') |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
122 call assert_fails('helptags Xdir', 'E153:', getfperm('Xdir/b/doc/sample.txt')) |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
123 call delete('Xdir', 'rf') |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
124 endfunc |
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
125 |
24882
4c1b6f3eb96b
patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
24172
diff
changeset
|
126 " Test for setting the 'helpheight' option in the help window |
4c1b6f3eb96b
patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
24172
diff
changeset
|
127 func Test_help_window_height() |
4c1b6f3eb96b
patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
24172
diff
changeset
|
128 let &cmdheight = &lines - 24 |
4c1b6f3eb96b
patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
24172
diff
changeset
|
129 set helpheight=10 |
4c1b6f3eb96b
patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
24172
diff
changeset
|
130 help |
4c1b6f3eb96b
patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
24172
diff
changeset
|
131 set helpheight=14 |
4c1b6f3eb96b
patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
24172
diff
changeset
|
132 call assert_equal(14, winheight(0)) |
4c1b6f3eb96b
patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
24172
diff
changeset
|
133 set helpheight& cmdheight=1 |
4c1b6f3eb96b
patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
24172
diff
changeset
|
134 close |
4c1b6f3eb96b
patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
24172
diff
changeset
|
135 endfunc |
24164
2259c73cc1d9
patch 8.2.2623: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents:
24057
diff
changeset
|
136 |
26276
35d000f3d591
patch 8.2.3669: buffer overflow with long help argument
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
137 func Test_help_long_argument() |
35d000f3d591
patch 8.2.3669: buffer overflow with long help argument
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
138 try |
35d000f3d591
patch 8.2.3669: buffer overflow with long help argument
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
139 exe 'help \%' .. repeat('0', 1021) |
35d000f3d591
patch 8.2.3669: buffer overflow with long help argument
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
140 catch |
35d000f3d591
patch 8.2.3669: buffer overflow with long help argument
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
141 call assert_match("E149:", v:exception) |
35d000f3d591
patch 8.2.3669: buffer overflow with long help argument
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
142 endtry |
35d000f3d591
patch 8.2.3669: buffer overflow with long help argument
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
143 endfunc |
35d000f3d591
patch 8.2.3669: buffer overflow with long help argument
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
144 |
35d000f3d591
patch 8.2.3669: buffer overflow with long help argument
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
145 |
19289
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
146 " vim: shiftwidth=2 sts=2 expandtab |