Mercurial > vim
annotate src/testdir/test_help.vim @ 19015:a3d9a5e14c1f v8.2.0068
patch 8.2.0068: crash when using Python 3 with "utf32" encoding
Commit: https://github.com/vim/vim/commit/556684ff71e044a642879d759373a7ebc5047fad
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Dec 31 21:59:01 2019 +0100
patch 8.2.0068: crash when using Python 3 with "utf32" encoding
Problem: Crash when using Python 3 with "utf32" encoding. (Dominique Pelle)
Solution: Use "utf-8" whenever enc_utf8 is set. (closes https://github.com/vim/vim/issues/5423)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 31 Dec 2019 22:00:03 +0100 |
parents | 5bef1043abff |
children | 1b02482e6a61 |
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 |