Skip to content

Commit 751ba61

Browse files
committed
patch 8.0.0470: not enough testing for help commands
Problem: Not enough testing for help commands. Solution: Add a few more help tests. (Dominique Pelle, closes #1565)
1 parent 0c0d4ec commit 751ba61

File tree

3 files changed

+63
-0
lines changed

3 files changed

+63
-0
lines changed

src/testdir/test_help.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ func Test_help_restore_snapshot()
88
help
99
helpclose
1010
endfunc
11+
12+
func Test_help_errors()
13+
call assert_fails('help doesnotexist', 'E149:')
14+
call assert_fails('help!', 'E478:')
15+
endfunc

src/testdir/test_help_tagjump.vim

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,52 @@ func Test_help_tagjump()
66
call assert_true(getline('.') =~ '\*help.txt\*')
77
helpclose
88

9+
help |
10+
call assert_equal("help", &filetype)
11+
call assert_true(getline('.') =~ '\*bar\*')
12+
helpclose
13+
14+
help "*
15+
call assert_equal("help", &filetype)
16+
call assert_true(getline('.') =~ '\*quotestar\*')
17+
helpclose
18+
19+
help sm?le
20+
call assert_equal("help", &filetype)
21+
call assert_true(getline('.') =~ '\*:smile\*')
22+
helpclose
23+
24+
help :?
25+
call assert_equal("help", &filetype)
26+
call assert_true(getline('.') =~ '\*:?\*')
27+
helpclose
28+
29+
help FileW*Post
30+
call assert_equal("help", &filetype)
31+
call assert_true(getline('.') =~ '\*FileWritePost\*')
32+
helpclose
33+
34+
help `ls`
35+
call assert_equal("help", &filetype)
36+
call assert_true(getline('.') =~ '\*:ls\*')
37+
helpclose
38+
39+
help ^X
40+
call assert_equal("help", &filetype)
41+
call assert_true(getline('.') =~ '\*CTRL-X\*')
42+
helpclose
43+
44+
help i_^_CTRL-D
45+
call assert_equal("help", &filetype)
46+
call assert_true(getline('.') =~ '\*i_^_CTRL-D\*')
47+
helpclose
48+
49+
exec "help \<C-V>"
50+
call assert_equal("help", &filetype)
51+
call assert_true(getline('.') =~ '\*CTRL-V\*')
52+
helpclose
53+
54+
955
exec "help! ('textwidth'"
1056
call assert_equal("help", &filetype)
1157
call assert_true(getline('.') =~ "\\*'textwidth'\\*")
@@ -35,6 +81,16 @@ func Test_help_tagjump()
3581
call assert_equal("help", &filetype)
3682
call assert_true(getline('.') =~ '\*{address}\*')
3783
helpclose
84+
85+
exusage
86+
call assert_equal("help", &filetype)
87+
call assert_true(getline('.') =~ '\*:index\*')
88+
helpclose
89+
90+
viusage
91+
call assert_equal("help", &filetype)
92+
call assert_true(getline('.') =~ '\*normal-index\*')
93+
helpclose
3894
endfunc
3995

4096
let s:langs = ['en', 'ab', 'ja']

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
470,
767769
/**/
768770
469,
769771
/**/

0 commit comments

Comments
 (0)