annotate src/testdir/test_help.vim @ 16720:9c90cf08cfa8 v8.1.1362

patch 8.1.1362: code and data in tests can be hard to read commit https://github.com/vim/vim/commit/c79745a82faeb5a6058e915ca49a4c69fa60ea01 Author: Bram Moolenaar <Bram@vim.org> Date: Mon May 20 22:12:34 2019 +0200 patch 8.1.1362: code and data in tests can be hard to read Problem: Code and data in tests can be hard to read. Solution: Use the new heredoc style. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/4400)
author Bram Moolenaar <Bram@vim.org>
date Mon, 20 May 2019 22:15:06 +0200
parents e1deb00ffc27
children d0dfb3b0fe31
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
55cf556d8ce1 patch 8.0.0998: strange error when using K while only spaces are selected
Christian Brabandt <cb@256bit.org>
parents: 11167
diff changeset
23 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
24 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
25 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
26 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
27 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
28 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
29 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
30 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
31 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
32 endfunc
13014
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
33
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
34 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
35 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
36 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
37 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
38 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
39 set rtp+=./Xruntime
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
40 help
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
41 1
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
42 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
43 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
44 1
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
45 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
46 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
47 close
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
48
e1deb00ffc27 patch 8.0.1383: local additions in help skips some files
Christian Brabandt <cb@256bit.org>
parents: 12236
diff changeset
49 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
50 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
51 endfunc