Mercurial > vim
annotate src/testdir/test_options.vim @ 20089:7fc5d62fe2a5 v8.2.0600
patch 8.2.0600: Vim9: cannot read or write w:, t: and b: variables
Commit: https://github.com/vim/vim/commit/d3aac2917db38f8590648ee76eebfa178fc4c069
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Apr 19 14:32:17 2020 +0200
patch 8.2.0600: Vim9: cannot read or write w:, t: and b: variables
Problem: Vim9: cannot read or write w:, t: and b: variables.
Solution: Implement load and store for w:, t: and b: variables.
(closes #5950)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 19 Apr 2020 14:45:03 +0200 |
parents | d13f8ae3b1de |
children | fadb7f84beff |
rev | line source |
---|---|
9798
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Test for options |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
17657
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
3 source check.vim |
19906
031184ace7c5
patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
4 source view_util.vim |
17657
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
5 |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
14869
diff
changeset
|
6 func Test_whichwrap() |
9798
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 set whichwrap=b,s |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 call assert_equal('b,s', &whichwrap) |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 set whichwrap+=h,l |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 call assert_equal('b,s,h,l', &whichwrap) |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 set whichwrap+=h,l |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 call assert_equal('b,s,h,l', &whichwrap) |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 set whichwrap+=h,l |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 call assert_equal('b,s,h,l', &whichwrap) |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 |
10831
e926c5a7f9bf
patch 8.0.0305: invalid memory access when option has duplicate flag
Christian Brabandt <cb@256bit.org>
parents:
10823
diff
changeset
|
19 set whichwrap=h,h |
e926c5a7f9bf
patch 8.0.0305: invalid memory access when option has duplicate flag
Christian Brabandt <cb@256bit.org>
parents:
10823
diff
changeset
|
20 call assert_equal('h', &whichwrap) |
e926c5a7f9bf
patch 8.0.0305: invalid memory access when option has duplicate flag
Christian Brabandt <cb@256bit.org>
parents:
10823
diff
changeset
|
21 |
e926c5a7f9bf
patch 8.0.0305: invalid memory access when option has duplicate flag
Christian Brabandt <cb@256bit.org>
parents:
10823
diff
changeset
|
22 set whichwrap=h,h,h |
e926c5a7f9bf
patch 8.0.0305: invalid memory access when option has duplicate flag
Christian Brabandt <cb@256bit.org>
parents:
10823
diff
changeset
|
23 call assert_equal('h', &whichwrap) |
e926c5a7f9bf
patch 8.0.0305: invalid memory access when option has duplicate flag
Christian Brabandt <cb@256bit.org>
parents:
10823
diff
changeset
|
24 |
19969
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
25 " For compatibility with Vim 3.0 and before, number values are also |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
26 " supported for 'whichwrap' |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
27 set whichwrap=1 |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
28 call assert_equal('b', &whichwrap) |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
29 set whichwrap=2 |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
30 call assert_equal('s', &whichwrap) |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
31 set whichwrap=4 |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
32 call assert_equal('h,l', &whichwrap) |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
33 set whichwrap=8 |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
34 call assert_equal('<,>', &whichwrap) |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
35 set whichwrap=16 |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
36 call assert_equal('[,]', &whichwrap) |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
37 set whichwrap=31 |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
38 call assert_equal('b,s,h,l,<,>,[,]', &whichwrap) |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
39 |
9798
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 set whichwrap& |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
14869
diff
changeset
|
41 endfunc |
9798
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
14869
diff
changeset
|
43 func Test_isfname() |
10932
141fe140976c
patch 8.0.0355: using uninitialized memory when 'isfname' is empty
Christian Brabandt <cb@256bit.org>
parents:
10906
diff
changeset
|
44 " This used to cause Vim to access uninitialized memory. |
141fe140976c
patch 8.0.0355: using uninitialized memory when 'isfname' is empty
Christian Brabandt <cb@256bit.org>
parents:
10906
diff
changeset
|
45 set isfname= |
141fe140976c
patch 8.0.0355: using uninitialized memory when 'isfname' is empty
Christian Brabandt <cb@256bit.org>
parents:
10906
diff
changeset
|
46 call assert_equal("~X", expand("~X")) |
141fe140976c
patch 8.0.0355: using uninitialized memory when 'isfname' is empty
Christian Brabandt <cb@256bit.org>
parents:
10906
diff
changeset
|
47 set isfname& |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
14869
diff
changeset
|
48 endfunc |
10932
141fe140976c
patch 8.0.0355: using uninitialized memory when 'isfname' is empty
Christian Brabandt <cb@256bit.org>
parents:
10906
diff
changeset
|
49 |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
14869
diff
changeset
|
50 func Test_wildchar() |
10962
6da4287fd735
patch 8.0.0370: invalid memory access when setting wildchar empty
Christian Brabandt <cb@256bit.org>
parents:
10958
diff
changeset
|
51 " Empty 'wildchar' used to access invalid memory. |
6da4287fd735
patch 8.0.0370: invalid memory access when setting wildchar empty
Christian Brabandt <cb@256bit.org>
parents:
10958
diff
changeset
|
52 call assert_fails('set wildchar=', 'E521:') |
6da4287fd735
patch 8.0.0370: invalid memory access when setting wildchar empty
Christian Brabandt <cb@256bit.org>
parents:
10958
diff
changeset
|
53 call assert_fails('set wildchar=abc', 'E521:') |
6da4287fd735
patch 8.0.0370: invalid memory access when setting wildchar empty
Christian Brabandt <cb@256bit.org>
parents:
10958
diff
changeset
|
54 set wildchar=<Esc> |
6da4287fd735
patch 8.0.0370: invalid memory access when setting wildchar empty
Christian Brabandt <cb@256bit.org>
parents:
10958
diff
changeset
|
55 let a=execute('set wildchar?') |
6da4287fd735
patch 8.0.0370: invalid memory access when setting wildchar empty
Christian Brabandt <cb@256bit.org>
parents:
10958
diff
changeset
|
56 call assert_equal("\n wildchar=<Esc>", a) |
6da4287fd735
patch 8.0.0370: invalid memory access when setting wildchar empty
Christian Brabandt <cb@256bit.org>
parents:
10958
diff
changeset
|
57 set wildchar=27 |
6da4287fd735
patch 8.0.0370: invalid memory access when setting wildchar empty
Christian Brabandt <cb@256bit.org>
parents:
10958
diff
changeset
|
58 let a=execute('set wildchar?') |
6da4287fd735
patch 8.0.0370: invalid memory access when setting wildchar empty
Christian Brabandt <cb@256bit.org>
parents:
10958
diff
changeset
|
59 call assert_equal("\n wildchar=<Esc>", a) |
6da4287fd735
patch 8.0.0370: invalid memory access when setting wildchar empty
Christian Brabandt <cb@256bit.org>
parents:
10958
diff
changeset
|
60 set wildchar& |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
14869
diff
changeset
|
61 endfunc |
10962
6da4287fd735
patch 8.0.0370: invalid memory access when setting wildchar empty
Christian Brabandt <cb@256bit.org>
parents:
10958
diff
changeset
|
62 |
19137
69f0e9b5c107
patch 8.2.0128: cannot list options one per line
Bram Moolenaar <Bram@vim.org>
parents:
18977
diff
changeset
|
63 func Test_options_command() |
9798
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
64 let caught = 'ok' |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
65 try |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
66 options |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
67 catch |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
68 let caught = v:throwpoint . "\n" . v:exception |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
69 endtry |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
70 call assert_equal('ok', caught) |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
71 |
16722
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
72 " Check if the option-window is opened horizontally. |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
73 wincmd j |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
74 call assert_notequal('option-window', bufname('')) |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
75 wincmd k |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
76 call assert_equal('option-window', bufname('')) |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
77 " close option-window |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
78 close |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
79 |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
80 " Open the option-window vertically. |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
81 vert options |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
82 " Check if the option-window is opened vertically. |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
83 wincmd l |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
84 call assert_notequal('option-window', bufname('')) |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
85 wincmd h |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
86 call assert_equal('option-window', bufname('')) |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
87 " close option-window |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
88 close |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
89 |
20043
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19991
diff
changeset
|
90 " Open the option-window at the top. |
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19991
diff
changeset
|
91 set splitbelow |
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19991
diff
changeset
|
92 topleft options |
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19991
diff
changeset
|
93 call assert_equal(1, winnr()) |
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19991
diff
changeset
|
94 close |
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19991
diff
changeset
|
95 |
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19991
diff
changeset
|
96 " Open the option-window at the bottom. |
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19991
diff
changeset
|
97 set nosplitbelow |
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19991
diff
changeset
|
98 botright options |
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19991
diff
changeset
|
99 call assert_equal(winnr('$'), winnr()) |
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19991
diff
changeset
|
100 close |
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19991
diff
changeset
|
101 set splitbelow& |
d13f8ae3b1de
patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents:
19991
diff
changeset
|
102 |
16722
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
103 " Open the option-window in a new tab. |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
104 tab options |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
105 " Check if the option-window is opened in a tab. |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
106 normal gT |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
107 call assert_notequal('option-window', bufname('')) |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
108 normal gt |
19ca17f9e155
patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents:
16664
diff
changeset
|
109 call assert_equal('option-window', bufname('')) |
9798
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
110 " close option-window |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
111 close |
19969
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
112 |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
113 " Open the options window browse |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
114 if has('browse') |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
115 browse set |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
116 call assert_equal('option-window', bufname('')) |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
117 close |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
118 endif |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
14869
diff
changeset
|
119 endfunc |
9798
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
120 |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
14869
diff
changeset
|
121 func Test_path_keep_commas() |
9798
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
122 " Test that changing 'path' keeps two commas. |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
123 set path=foo,,bar |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
124 set path-=bar |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
125 set path+=bar |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
126 call assert_equal('foo,,bar', &path) |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
127 |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
128 set path& |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
14869
diff
changeset
|
129 endfunc |
9852
4eea48b76d03
commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents:
9798
diff
changeset
|
130 |
4eea48b76d03
commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents:
9798
diff
changeset
|
131 func Test_signcolumn() |
9856
12c5c2614432
commit https://github.com/vim/vim/commit/ebcccad573a7722e16cf2dd435cc62b61f61d9cc
Christian Brabandt <cb@256bit.org>
parents:
9852
diff
changeset
|
132 if has('signs') |
12c5c2614432
commit https://github.com/vim/vim/commit/ebcccad573a7722e16cf2dd435cc62b61f61d9cc
Christian Brabandt <cb@256bit.org>
parents:
9852
diff
changeset
|
133 call assert_equal("auto", &signcolumn) |
12c5c2614432
commit https://github.com/vim/vim/commit/ebcccad573a7722e16cf2dd435cc62b61f61d9cc
Christian Brabandt <cb@256bit.org>
parents:
9852
diff
changeset
|
134 set signcolumn=yes |
12c5c2614432
commit https://github.com/vim/vim/commit/ebcccad573a7722e16cf2dd435cc62b61f61d9cc
Christian Brabandt <cb@256bit.org>
parents:
9852
diff
changeset
|
135 set signcolumn=no |
12c5c2614432
commit https://github.com/vim/vim/commit/ebcccad573a7722e16cf2dd435cc62b61f61d9cc
Christian Brabandt <cb@256bit.org>
parents:
9852
diff
changeset
|
136 call assert_fails('set signcolumn=nope') |
12c5c2614432
commit https://github.com/vim/vim/commit/ebcccad573a7722e16cf2dd435cc62b61f61d9cc
Christian Brabandt <cb@256bit.org>
parents:
9852
diff
changeset
|
137 endif |
9852
4eea48b76d03
commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents:
9798
diff
changeset
|
138 endfunc |
4eea48b76d03
commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents:
9798
diff
changeset
|
139 |
10322
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
140 func Test_filetype_valid() |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
141 set ft=valid_name |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
142 call assert_equal("valid_name", &filetype) |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
143 set ft=valid-name |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
144 call assert_equal("valid-name", &filetype) |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
145 |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
146 call assert_fails(":set ft=wrong;name", "E474:") |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
147 call assert_fails(":set ft=wrong\\\\name", "E474:") |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
148 call assert_fails(":set ft=wrong\\|name", "E474:") |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
149 call assert_fails(":set ft=wrong/name", "E474:") |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
150 call assert_fails(":set ft=wrong\\\nname", "E474:") |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
151 call assert_equal("valid-name", &filetype) |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
152 |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
153 exe "set ft=trunc\x00name" |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
154 call assert_equal("trunc", &filetype) |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
155 endfunc |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
156 |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
157 func Test_syntax_valid() |
10324
ecbd3412f214
commit https://github.com/vim/vim/commit/9376f5f482a4d579436bf364778c2d8ab8e2f22d
Christian Brabandt <cb@256bit.org>
parents:
10322
diff
changeset
|
158 if !has('syntax') |
ecbd3412f214
commit https://github.com/vim/vim/commit/9376f5f482a4d579436bf364778c2d8ab8e2f22d
Christian Brabandt <cb@256bit.org>
parents:
10322
diff
changeset
|
159 return |
ecbd3412f214
commit https://github.com/vim/vim/commit/9376f5f482a4d579436bf364778c2d8ab8e2f22d
Christian Brabandt <cb@256bit.org>
parents:
10322
diff
changeset
|
160 endif |
10322
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
161 set syn=valid_name |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
162 call assert_equal("valid_name", &syntax) |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
163 set syn=valid-name |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
164 call assert_equal("valid-name", &syntax) |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
165 |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
166 call assert_fails(":set syn=wrong;name", "E474:") |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
167 call assert_fails(":set syn=wrong\\\\name", "E474:") |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
168 call assert_fails(":set syn=wrong\\|name", "E474:") |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
169 call assert_fails(":set syn=wrong/name", "E474:") |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
170 call assert_fails(":set syn=wrong\\\nname", "E474:") |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
171 call assert_equal("valid-name", &syntax) |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
172 |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
173 exe "set syn=trunc\x00name" |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
174 call assert_equal("trunc", &syntax) |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
175 endfunc |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
176 |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
177 func Test_keymap_valid() |
10324
ecbd3412f214
commit https://github.com/vim/vim/commit/9376f5f482a4d579436bf364778c2d8ab8e2f22d
Christian Brabandt <cb@256bit.org>
parents:
10322
diff
changeset
|
178 if !has('keymap') |
ecbd3412f214
commit https://github.com/vim/vim/commit/9376f5f482a4d579436bf364778c2d8ab8e2f22d
Christian Brabandt <cb@256bit.org>
parents:
10322
diff
changeset
|
179 return |
ecbd3412f214
commit https://github.com/vim/vim/commit/9376f5f482a4d579436bf364778c2d8ab8e2f22d
Christian Brabandt <cb@256bit.org>
parents:
10322
diff
changeset
|
180 endif |
10322
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
181 call assert_fails(":set kmp=valid_name", "E544:") |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
182 call assert_fails(":set kmp=valid_name", "valid_name") |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
183 call assert_fails(":set kmp=valid-name", "E544:") |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
184 call assert_fails(":set kmp=valid-name", "valid-name") |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
185 |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
186 call assert_fails(":set kmp=wrong;name", "E474:") |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
187 call assert_fails(":set kmp=wrong\\\\name", "E474:") |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
188 call assert_fails(":set kmp=wrong\\|name", "E474:") |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
189 call assert_fails(":set kmp=wrong/name", "E474:") |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
190 call assert_fails(":set kmp=wrong\\\nname", "E474:") |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
191 |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
192 call assert_fails(":set kmp=trunc\x00name", "E544:") |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
193 call assert_fails(":set kmp=trunc\x00name", "trunc") |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
194 endfunc |
10416
ef5474130b0e
commit https://github.com/vim/vim/commit/7554da4033498c4da0af3cde542c3e87e9097b73
Christian Brabandt <cb@256bit.org>
parents:
10324
diff
changeset
|
195 |
10420
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
196 func Check_dir_option(name) |
10416
ef5474130b0e
commit https://github.com/vim/vim/commit/7554da4033498c4da0af3cde542c3e87e9097b73
Christian Brabandt <cb@256bit.org>
parents:
10324
diff
changeset
|
197 " Check that it's possible to set the option. |
10420
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
198 exe 'set ' . a:name . '=/usr/share/dict/words' |
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
199 call assert_equal('/usr/share/dict/words', eval('&' . a:name)) |
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
200 exe 'set ' . a:name . '=/usr/share/dict/words,/and/there' |
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
201 call assert_equal('/usr/share/dict/words,/and/there', eval('&' . a:name)) |
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
202 exe 'set ' . a:name . '=/usr/share/dict\ words' |
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
203 call assert_equal('/usr/share/dict words', eval('&' . a:name)) |
10416
ef5474130b0e
commit https://github.com/vim/vim/commit/7554da4033498c4da0af3cde542c3e87e9097b73
Christian Brabandt <cb@256bit.org>
parents:
10324
diff
changeset
|
204 |
ef5474130b0e
commit https://github.com/vim/vim/commit/7554da4033498c4da0af3cde542c3e87e9097b73
Christian Brabandt <cb@256bit.org>
parents:
10324
diff
changeset
|
205 " Check rejecting weird characters. |
10420
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
206 call assert_fails("set " . a:name . "=/not&there", "E474:") |
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
207 call assert_fails("set " . a:name . "=/not>there", "E474:") |
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
208 call assert_fails("set " . a:name . "=/not.*there", "E474:") |
10416
ef5474130b0e
commit https://github.com/vim/vim/commit/7554da4033498c4da0af3cde542c3e87e9097b73
Christian Brabandt <cb@256bit.org>
parents:
10324
diff
changeset
|
209 endfunc |
10420
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
210 |
10938
3b82ab325d59
patch 8.0.0358: invalid memory access in C-indent code
Christian Brabandt <cb@256bit.org>
parents:
10936
diff
changeset
|
211 func Test_cinkeys() |
3b82ab325d59
patch 8.0.0358: invalid memory access in C-indent code
Christian Brabandt <cb@256bit.org>
parents:
10936
diff
changeset
|
212 " This used to cause invalid memory access |
3b82ab325d59
patch 8.0.0358: invalid memory access in C-indent code
Christian Brabandt <cb@256bit.org>
parents:
10936
diff
changeset
|
213 set cindent cinkeys=0 |
3b82ab325d59
patch 8.0.0358: invalid memory access in C-indent code
Christian Brabandt <cb@256bit.org>
parents:
10936
diff
changeset
|
214 norm a |
3b82ab325d59
patch 8.0.0358: invalid memory access in C-indent code
Christian Brabandt <cb@256bit.org>
parents:
10936
diff
changeset
|
215 set cindent& cinkeys& |
3b82ab325d59
patch 8.0.0358: invalid memory access in C-indent code
Christian Brabandt <cb@256bit.org>
parents:
10936
diff
changeset
|
216 endfunc |
3b82ab325d59
patch 8.0.0358: invalid memory access in C-indent code
Christian Brabandt <cb@256bit.org>
parents:
10936
diff
changeset
|
217 |
10420
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
218 func Test_dictionary() |
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
219 call Check_dir_option('dictionary') |
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
220 endfunc |
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
221 |
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
222 func Test_thesaurus() |
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
223 call Check_dir_option('thesaurus') |
10823
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
224 endfun |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
225 |
10887
40939b171432
patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Christian Brabandt <cb@256bit.org>
parents:
10831
diff
changeset
|
226 func Test_complete() |
40939b171432
patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Christian Brabandt <cb@256bit.org>
parents:
10831
diff
changeset
|
227 " Trailing single backslash used to cause invalid memory access. |
40939b171432
patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Christian Brabandt <cb@256bit.org>
parents:
10831
diff
changeset
|
228 set complete=s\ |
40939b171432
patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Christian Brabandt <cb@256bit.org>
parents:
10831
diff
changeset
|
229 new |
40939b171432
patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Christian Brabandt <cb@256bit.org>
parents:
10831
diff
changeset
|
230 call feedkeys("i\<C-N>\<Esc>", 'xt') |
40939b171432
patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Christian Brabandt <cb@256bit.org>
parents:
10831
diff
changeset
|
231 bwipe! |
19932
2c4d9ca33769
patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
232 call assert_fails('set complete=ix', 'E535:') |
10887
40939b171432
patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Christian Brabandt <cb@256bit.org>
parents:
10831
diff
changeset
|
233 set complete& |
40939b171432
patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Christian Brabandt <cb@256bit.org>
parents:
10831
diff
changeset
|
234 endfun |
40939b171432
patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Christian Brabandt <cb@256bit.org>
parents:
10831
diff
changeset
|
235 |
10823
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
236 func Test_set_completion() |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
237 call feedkeys(":set di\<C-A>\<C-B>\"\<CR>", 'tx') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
238 call assert_equal('"set dictionary diff diffexpr diffopt digraph directory display', @:) |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
239 |
18977
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18973
diff
changeset
|
240 call feedkeys(":setlocal di\<C-A>\<C-B>\"\<CR>", 'tx') |
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18973
diff
changeset
|
241 call assert_equal('"setlocal dictionary diff diffexpr diffopt digraph directory display', @:) |
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18973
diff
changeset
|
242 |
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18973
diff
changeset
|
243 call feedkeys(":setglobal di\<C-A>\<C-B>\"\<CR>", 'tx') |
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18973
diff
changeset
|
244 call assert_equal('"setglobal dictionary diff diffexpr diffopt digraph directory display', @:) |
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18973
diff
changeset
|
245 |
10823
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
246 " Expand boolan options. When doing :set no<Tab> |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
247 " vim displays the options names without "no" but completion uses "no...". |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
248 call feedkeys(":set nodi\<C-A>\<C-B>\"\<CR>", 'tx') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
249 call assert_equal('"set nodiff digraph', @:) |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
250 |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
251 call feedkeys(":set invdi\<C-A>\<C-B>\"\<CR>", 'tx') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
252 call assert_equal('"set invdiff digraph', @:) |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
253 |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
254 " Expand abbreviation of options. |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
255 call feedkeys(":set ts\<C-A>\<C-B>\"\<CR>", 'tx') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
256 call assert_equal('"set tabstop thesaurus ttyscroll', @:) |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
257 |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
258 " Expand current value |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
259 call feedkeys(":set fileencodings=\<C-A>\<C-B>\"\<CR>", 'tx') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
260 call assert_equal('"set fileencodings=ucs-bom,utf-8,default,latin1', @:) |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
261 |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
262 call feedkeys(":set fileencodings:\<C-A>\<C-B>\"\<CR>", 'tx') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
263 call assert_equal('"set fileencodings:ucs-bom,utf-8,default,latin1', @:) |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
264 |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
265 " Expand key codes. |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
266 call feedkeys(":set <H\<C-A>\<C-B>\"\<CR>", 'tx') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
267 call assert_equal('"set <Help> <Home>', @:) |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
268 |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
269 " Expand terminal options. |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
270 call feedkeys(":set t_A\<C-A>\<C-B>\"\<CR>", 'tx') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
271 call assert_equal('"set t_AB t_AF t_AL', @:) |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
272 |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
273 " Expand directories. |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
274 call feedkeys(":set cdpath=./\<C-A>\<C-B>\"\<CR>", 'tx') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
275 call assert_match(' ./samples/ ', @:) |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
276 call assert_notmatch(' ./small.vim ', @:) |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
277 |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
278 " Expand files and directories. |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
279 call feedkeys(":set tags=./\<C-A>\<C-B>\"\<CR>", 'tx') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
280 call assert_match(' ./samples/.* ./small.vim', @:) |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
281 |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
282 call feedkeys(":set tags=./\\\\ dif\<C-A>\<C-B>\"\<CR>", 'tx') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
283 call assert_equal('"set tags=./\\ diff diffexpr diffopt', @:) |
19991
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
284 set tags& |
18977
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18973
diff
changeset
|
285 |
19991
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
286 " Expanding the option names |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
287 call feedkeys(":set \<Tab>\<C-B>\"\<CR>", 'xt') |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
288 call assert_equal('"set all', @:) |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
289 |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
290 " Expanding a second set of option names |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
291 call feedkeys(":set wrapscan \<Tab>\<C-B>\"\<CR>", 'xt') |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
292 call assert_equal('"set wrapscan all', @:) |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
293 |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
294 " Expanding a special keycode |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
295 call feedkeys(":set <Home>\<Tab>\<C-B>\"\<CR>", 'xt') |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
296 call assert_equal('"set <Home>', @:) |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
297 |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
298 " Expanding an invalid special keycode |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
299 call feedkeys(":set <abcd>\<Tab>\<C-B>\"\<CR>", 'xt') |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
300 call assert_equal("\"set <abcd>\<Tab>", @:) |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
301 |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
302 " Expanding a terminal keycode |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
303 call feedkeys(":set t_AB\<Tab>\<C-B>\"\<CR>", 'xt') |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
304 call assert_equal("\"set t_AB", @:) |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
305 |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
306 " Expanding an invalid option name |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
307 call feedkeys(":set abcde=\<Tab>\<C-B>\"\<CR>", 'xt') |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
308 call assert_equal("\"set abcde=\<Tab>", @:) |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
309 |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
310 " Expanding after a = for a boolean option |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
311 call feedkeys(":set wrapscan=\<Tab>\<C-B>\"\<CR>", 'xt') |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
312 call assert_equal("\"set wrapscan=\<Tab>", @:) |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
313 |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
314 " Expanding a numeric option |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
315 call feedkeys(":set tabstop+=\<Tab>\<C-B>\"\<CR>", 'xt') |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
316 call assert_equal("\"set tabstop+=" .. &tabstop, @:) |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
317 |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
318 " Expanding a non-boolean option |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
319 call feedkeys(":set invtabstop=\<Tab>\<C-B>\"\<CR>", 'xt') |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
320 call assert_equal("\"set invtabstop=", @:) |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
321 |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
322 " Expand options for 'spellsuggest' |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
323 call feedkeys(":set spellsuggest=best,file:xyz\<Tab>\<C-B>\"\<CR>", 'xt') |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
324 call assert_equal("\"set spellsuggest=best,file:xyz", @:) |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
325 |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
326 " Expand value for 'key' |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
327 set key=abcd |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
328 call feedkeys(":set key=\<Tab>\<C-B>\"\<CR>", 'xt') |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
329 call assert_equal('"set key=*****', @:) |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
330 set key= |
10420
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
331 endfunc |
10823
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
332 |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
333 func Test_set_errors() |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
334 call assert_fails('set scroll=-1', 'E49:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
335 call assert_fails('set backupcopy=', 'E474:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
336 call assert_fails('set regexpengine=3', 'E474:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
337 call assert_fails('set history=10001', 'E474:') |
17229
f1c7b7a4d9e4
patch 8.1.1614: 'numberwidth' can only go up to 10
Bram Moolenaar <Bram@vim.org>
parents:
17093
diff
changeset
|
338 call assert_fails('set numberwidth=21', 'E474:') |
19740
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19693
diff
changeset
|
339 call assert_fails('set colorcolumn=-a', 'E474:') |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19693
diff
changeset
|
340 call assert_fails('set colorcolumn=a', 'E474:') |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19693
diff
changeset
|
341 call assert_fails('set colorcolumn=1,', 'E474:') |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19693
diff
changeset
|
342 call assert_fails('set colorcolumn=1;', 'E474:') |
10823
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
343 call assert_fails('set cmdheight=-1', 'E487:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
344 call assert_fails('set cmdwinheight=-1', 'E487:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
345 if has('conceal') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
346 call assert_fails('set conceallevel=-1', 'E487:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
347 call assert_fails('set conceallevel=4', 'E474:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
348 endif |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
349 call assert_fails('set helpheight=-1', 'E487:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
350 call assert_fails('set history=-1', 'E487:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
351 call assert_fails('set report=-1', 'E487:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
352 call assert_fails('set shiftwidth=-1', 'E487:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
353 call assert_fails('set sidescroll=-1', 'E487:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
354 call assert_fails('set tabstop=-1', 'E487:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
355 call assert_fails('set textwidth=-1', 'E487:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
356 call assert_fails('set timeoutlen=-1', 'E487:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
357 call assert_fails('set updatecount=-1', 'E487:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
358 call assert_fails('set updatetime=-1', 'E487:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
359 call assert_fails('set winheight=-1', 'E487:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
360 call assert_fails('set tabstop!', 'E488:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
361 call assert_fails('set xxx', 'E518:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
362 call assert_fails('set beautify?', 'E519:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
363 call assert_fails('set undolevels=x', 'E521:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
364 call assert_fails('set tabstop=', 'E521:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
365 call assert_fails('set comments=-', 'E524:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
366 call assert_fails('set comments=a', 'E525:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
367 call assert_fails('set foldmarker=x', 'E536:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
368 call assert_fails('set commentstring=x', 'E537:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
369 call assert_fails('set complete=x', 'E539:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
370 call assert_fails('set statusline=%{', 'E540:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
371 call assert_fails('set statusline=' . repeat("%p", 81), 'E541:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
372 call assert_fails('set statusline=%(', 'E542:') |
10936
a516b6c279d9
patch 8.0.0357: crash when setting 'guicursor' to weird value
Christian Brabandt <cb@256bit.org>
parents:
10932
diff
changeset
|
373 if has('cursorshape') |
a516b6c279d9
patch 8.0.0357: crash when setting 'guicursor' to weird value
Christian Brabandt <cb@256bit.org>
parents:
10932
diff
changeset
|
374 " This invalid value for 'guicursor' used to cause Vim to crash. |
a516b6c279d9
patch 8.0.0357: crash when setting 'guicursor' to weird value
Christian Brabandt <cb@256bit.org>
parents:
10932
diff
changeset
|
375 call assert_fails('set guicursor=i-ci,r-cr:h', 'E545:') |
a516b6c279d9
patch 8.0.0357: crash when setting 'guicursor' to weird value
Christian Brabandt <cb@256bit.org>
parents:
10932
diff
changeset
|
376 call assert_fails('set guicursor=i-ci', 'E545:') |
a516b6c279d9
patch 8.0.0357: crash when setting 'guicursor' to weird value
Christian Brabandt <cb@256bit.org>
parents:
10932
diff
changeset
|
377 call assert_fails('set guicursor=x', 'E545:') |
19740
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19693
diff
changeset
|
378 call assert_fails('set guicursor=x:', 'E546:') |
10936
a516b6c279d9
patch 8.0.0357: crash when setting 'guicursor' to weird value
Christian Brabandt <cb@256bit.org>
parents:
10932
diff
changeset
|
379 call assert_fails('set guicursor=r-cr:horx', 'E548:') |
a516b6c279d9
patch 8.0.0357: crash when setting 'guicursor' to weird value
Christian Brabandt <cb@256bit.org>
parents:
10932
diff
changeset
|
380 call assert_fails('set guicursor=r-cr:hor0', 'E549:') |
a516b6c279d9
patch 8.0.0357: crash when setting 'guicursor' to weird value
Christian Brabandt <cb@256bit.org>
parents:
10932
diff
changeset
|
381 endif |
19740
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19693
diff
changeset
|
382 if has('mouseshape') |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19693
diff
changeset
|
383 call assert_fails('se mouseshape=i-r:x', 'E547:') |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19693
diff
changeset
|
384 endif |
10823
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
385 call assert_fails('set backupext=~ patchmode=~', 'E589:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
386 call assert_fails('set winminheight=10 winheight=9', 'E591:') |
19991
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
387 set winminheight& winheight& |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
388 set winheight=10 winminheight=10 |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
389 call assert_fails('set winheight=9', 'E591:') |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
390 set winminheight& winheight& |
10823
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
391 call assert_fails('set winminwidth=10 winwidth=9', 'E592:') |
19991
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
392 set winminwidth& winwidth& |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
393 call assert_fails('set winwidth=9 winminwidth=10', 'E592:') |
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
394 set winwidth& winminwidth& |
10823
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
395 call assert_fails("set showbreak=\x01", 'E595:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
396 call assert_fails('set t_foo=', 'E846:') |
19969
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
397 call assert_fails('set tabstop??', 'E488:') |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
398 call assert_fails('set wrapscan!!', 'E488:') |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
399 call assert_fails('set tabstop&&', 'E488:') |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
400 call assert_fails('set wrapscan<<', 'E488:') |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
401 call assert_fails('set wrapscan=1', 'E474:') |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
402 call assert_fails('set autoindent@', 'E488:') |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
403 call assert_fails('set wildchar=<abc>', 'E474:') |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
404 call assert_fails('set cmdheight=1a', 'E521:') |
19991
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
405 call assert_fails('set invcmdheight', 'E474:') |
19969
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
406 if has('python') && has('python3') |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
407 call assert_fails('set pyxversion=6', 'E474:') |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
408 endif |
19991
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
409 call assert_fails("let &tabstop='ab'", 'E521:') |
10823
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
410 endfunc |
10906
7fc1df5536c9
patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents:
10887
diff
changeset
|
411 |
18380
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
412 func CheckWasSet(name) |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
413 let verb_cm = execute('verbose set ' .. a:name .. '?') |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
414 call assert_match('Last set from.*test_options.vim', verb_cm) |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
415 endfunc |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
416 func CheckWasNotSet(name) |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
417 let verb_cm = execute('verbose set ' .. a:name .. '?') |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
418 call assert_notmatch('Last set from', verb_cm) |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
419 endfunc |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
420 |
14867
cf4d6489c9eb
patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents:
14617
diff
changeset
|
421 " Must be executed before other tests that set 'term'. |
cf4d6489c9eb
patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents:
14617
diff
changeset
|
422 func Test_000_term_option_verbose() |
17657
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
423 CheckNotGui |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
424 |
18380
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
425 call CheckWasNotSet('t_cm') |
14867
cf4d6489c9eb
patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents:
14617
diff
changeset
|
426 |
cf4d6489c9eb
patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents:
14617
diff
changeset
|
427 let term_save = &term |
cf4d6489c9eb
patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents:
14617
diff
changeset
|
428 set term=ansi |
18380
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
429 call CheckWasSet('t_cm') |
14867
cf4d6489c9eb
patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents:
14617
diff
changeset
|
430 let &term = term_save |
cf4d6489c9eb
patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents:
14617
diff
changeset
|
431 endfunc |
cf4d6489c9eb
patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents:
14617
diff
changeset
|
432 |
18380
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
433 func Test_copy_context() |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
434 setlocal list |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
435 call CheckWasSet('list') |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
436 split |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
437 call CheckWasSet('list') |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
438 quit |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
439 setlocal nolist |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
440 |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
441 set ai |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
442 call CheckWasSet('ai') |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
443 set filetype=perl |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
444 call CheckWasSet('filetype') |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
445 set fo=tcroq |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
446 call CheckWasSet('fo') |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
447 |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
448 split Xsomebuf |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
449 call CheckWasSet('ai') |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
450 call CheckWasNotSet('filetype') |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
451 call CheckWasSet('fo') |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
452 endfunc |
212284f893d5
patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
453 |
10906
7fc1df5536c9
patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents:
10887
diff
changeset
|
454 func Test_set_ttytype() |
17657
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
455 CheckUnix |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
456 CheckNotGui |
11348
4e5191165707
patch 8.0.0559: setting ttytype to xxx does not always fail
Christian Brabandt <cb@256bit.org>
parents:
11081
diff
changeset
|
457 |
17657
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
458 " Setting 'ttytype' used to cause a double-free when exiting vim and |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
459 " when vim is compiled with -DEXITFREE. |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
460 set ttytype=ansi |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
461 call assert_equal('ansi', &ttytype) |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
462 call assert_equal(&ttytype, &term) |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
463 set ttytype=xterm |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
464 call assert_equal('xterm', &ttytype) |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
465 call assert_equal(&ttytype, &term) |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
466 " "set ttytype=" gives E522 instead of E529 |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
467 " in travis on some builds. Why? Catch both for now |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
468 try |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
469 set ttytype= |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
470 call assert_report('set ttytype= did not fail') |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
471 catch /E529\|E522/ |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
472 endtry |
11348
4e5191165707
patch 8.0.0559: setting ttytype to xxx does not always fail
Christian Brabandt <cb@256bit.org>
parents:
11081
diff
changeset
|
473 |
17657
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
474 " Some systems accept any terminal name and return dumb settings, |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
475 " check for failure of finding the entry and for missing 'cm' entry. |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
476 try |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
477 set ttytype=xxx |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
478 call assert_report('set ttytype=xxx did not fail') |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
479 catch /E522\|E437/ |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
480 endtry |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
481 |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
482 set ttytype& |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17229
diff
changeset
|
483 call assert_equal(&ttytype, &term) |
19932
2c4d9ca33769
patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
484 |
2c4d9ca33769
patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
485 if has('gui') && !has('gui_running') |
2c4d9ca33769
patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
486 call assert_fails('set term=gui', 'E531:') |
2c4d9ca33769
patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
487 endif |
10906
7fc1df5536c9
patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents:
10887
diff
changeset
|
488 endfunc |
10958
e5896de85dcf
patch 8.0.0368: not all options are tested with a range of values
Christian Brabandt <cb@256bit.org>
parents:
10938
diff
changeset
|
489 |
e5896de85dcf
patch 8.0.0368: not all options are tested with a range of values
Christian Brabandt <cb@256bit.org>
parents:
10938
diff
changeset
|
490 func Test_set_all() |
e5896de85dcf
patch 8.0.0368: not all options are tested with a range of values
Christian Brabandt <cb@256bit.org>
parents:
10938
diff
changeset
|
491 set tw=75 |
e5896de85dcf
patch 8.0.0368: not all options are tested with a range of values
Christian Brabandt <cb@256bit.org>
parents:
10938
diff
changeset
|
492 set iskeyword=a-z,A-Z |
e5896de85dcf
patch 8.0.0368: not all options are tested with a range of values
Christian Brabandt <cb@256bit.org>
parents:
10938
diff
changeset
|
493 set nosplitbelow |
e5896de85dcf
patch 8.0.0368: not all options are tested with a range of values
Christian Brabandt <cb@256bit.org>
parents:
10938
diff
changeset
|
494 let out = execute('set all') |
e5896de85dcf
patch 8.0.0368: not all options are tested with a range of values
Christian Brabandt <cb@256bit.org>
parents:
10938
diff
changeset
|
495 call assert_match('textwidth=75', out) |
e5896de85dcf
patch 8.0.0368: not all options are tested with a range of values
Christian Brabandt <cb@256bit.org>
parents:
10938
diff
changeset
|
496 call assert_match('iskeyword=a-z,A-Z', out) |
e5896de85dcf
patch 8.0.0368: not all options are tested with a range of values
Christian Brabandt <cb@256bit.org>
parents:
10938
diff
changeset
|
497 call assert_match('nosplitbelow', out) |
e5896de85dcf
patch 8.0.0368: not all options are tested with a range of values
Christian Brabandt <cb@256bit.org>
parents:
10938
diff
changeset
|
498 set tw& iskeyword& splitbelow& |
e5896de85dcf
patch 8.0.0368: not all options are tested with a range of values
Christian Brabandt <cb@256bit.org>
parents:
10938
diff
changeset
|
499 endfunc |
e5896de85dcf
patch 8.0.0368: not all options are tested with a range of values
Christian Brabandt <cb@256bit.org>
parents:
10938
diff
changeset
|
500 |
19137
69f0e9b5c107
patch 8.2.0128: cannot list options one per line
Bram Moolenaar <Bram@vim.org>
parents:
18977
diff
changeset
|
501 func Test_set_one_column() |
69f0e9b5c107
patch 8.2.0128: cannot list options one per line
Bram Moolenaar <Bram@vim.org>
parents:
18977
diff
changeset
|
502 let out_mult = execute('set all')->split("\n") |
69f0e9b5c107
patch 8.2.0128: cannot list options one per line
Bram Moolenaar <Bram@vim.org>
parents:
18977
diff
changeset
|
503 let out_one = execute('set! all')->split("\n") |
19752
0927df746554
patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
504 call assert_true(len(out_mult) < len(out_one)) |
19137
69f0e9b5c107
patch 8.2.0128: cannot list options one per line
Bram Moolenaar <Bram@vim.org>
parents:
18977
diff
changeset
|
505 endfunc |
69f0e9b5c107
patch 8.2.0128: cannot list options one per line
Bram Moolenaar <Bram@vim.org>
parents:
18977
diff
changeset
|
506 |
10958
e5896de85dcf
patch 8.0.0368: not all options are tested with a range of values
Christian Brabandt <cb@256bit.org>
parents:
10938
diff
changeset
|
507 func Test_set_values() |
e5896de85dcf
patch 8.0.0368: not all options are tested with a range of values
Christian Brabandt <cb@256bit.org>
parents:
10938
diff
changeset
|
508 if filereadable('opt_test.vim') |
e5896de85dcf
patch 8.0.0368: not all options are tested with a range of values
Christian Brabandt <cb@256bit.org>
parents:
10938
diff
changeset
|
509 source opt_test.vim |
11081
bbdb4f0134cb
patch 8.0.0429: options test does not always test everything
Christian Brabandt <cb@256bit.org>
parents:
10962
diff
changeset
|
510 else |
bbdb4f0134cb
patch 8.0.0429: options test does not always test everything
Christian Brabandt <cb@256bit.org>
parents:
10962
diff
changeset
|
511 throw 'Skipped: opt_test.vim does not exist' |
10958
e5896de85dcf
patch 8.0.0368: not all options are tested with a range of values
Christian Brabandt <cb@256bit.org>
parents:
10938
diff
changeset
|
512 endif |
e5896de85dcf
patch 8.0.0368: not all options are tested with a range of values
Christian Brabandt <cb@256bit.org>
parents:
10938
diff
changeset
|
513 endfunc |
11380
2334a8ae9ff6
patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents:
11348
diff
changeset
|
514 |
18973
bf8eb950df61
patch 8.2.0047: cannot skip tests for specific MS-Windows platform
Bram Moolenaar <Bram@vim.org>
parents:
18380
diff
changeset
|
515 func Test_renderoptions() |
bf8eb950df61
patch 8.2.0047: cannot skip tests for specific MS-Windows platform
Bram Moolenaar <Bram@vim.org>
parents:
18380
diff
changeset
|
516 " Only do this for Windows Vista and later, fails on Windows XP and earlier. |
bf8eb950df61
patch 8.2.0047: cannot skip tests for specific MS-Windows platform
Bram Moolenaar <Bram@vim.org>
parents:
18380
diff
changeset
|
517 " Doesn't hurt to do this on a non-Windows system. |
bf8eb950df61
patch 8.2.0047: cannot skip tests for specific MS-Windows platform
Bram Moolenaar <Bram@vim.org>
parents:
18380
diff
changeset
|
518 if windowsversion() !~ '^[345]\.' |
bf8eb950df61
patch 8.2.0047: cannot skip tests for specific MS-Windows platform
Bram Moolenaar <Bram@vim.org>
parents:
18380
diff
changeset
|
519 set renderoptions=type:directx |
bf8eb950df61
patch 8.2.0047: cannot skip tests for specific MS-Windows platform
Bram Moolenaar <Bram@vim.org>
parents:
18380
diff
changeset
|
520 set rop=type:directx |
bf8eb950df61
patch 8.2.0047: cannot skip tests for specific MS-Windows platform
Bram Moolenaar <Bram@vim.org>
parents:
18380
diff
changeset
|
521 endif |
bf8eb950df61
patch 8.2.0047: cannot skip tests for specific MS-Windows platform
Bram Moolenaar <Bram@vim.org>
parents:
18380
diff
changeset
|
522 endfunc |
bf8eb950df61
patch 8.2.0047: cannot skip tests for specific MS-Windows platform
Bram Moolenaar <Bram@vim.org>
parents:
18380
diff
changeset
|
523 |
11380
2334a8ae9ff6
patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents:
11348
diff
changeset
|
524 func ResetIndentexpr() |
2334a8ae9ff6
patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents:
11348
diff
changeset
|
525 set indentexpr= |
2334a8ae9ff6
patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents:
11348
diff
changeset
|
526 endfunc |
2334a8ae9ff6
patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents:
11348
diff
changeset
|
527 |
2334a8ae9ff6
patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents:
11348
diff
changeset
|
528 func Test_set_indentexpr() |
2334a8ae9ff6
patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents:
11348
diff
changeset
|
529 " this was causing usage of freed memory |
2334a8ae9ff6
patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents:
11348
diff
changeset
|
530 set indentexpr=ResetIndentexpr() |
2334a8ae9ff6
patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents:
11348
diff
changeset
|
531 new |
2334a8ae9ff6
patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents:
11348
diff
changeset
|
532 call feedkeys("i\<c-f>", 'x') |
2334a8ae9ff6
patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents:
11348
diff
changeset
|
533 call assert_equal('', &indentexpr) |
2334a8ae9ff6
patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents:
11348
diff
changeset
|
534 bwipe! |
2334a8ae9ff6
patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents:
11348
diff
changeset
|
535 endfunc |
13664
f64c5e636c9f
patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents:
11380
diff
changeset
|
536 |
f64c5e636c9f
patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents:
11380
diff
changeset
|
537 func Test_backupskip() |
15685
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
538 " Option 'backupskip' may contain several comma-separated path |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
539 " specifications if one or more of the environment variables TMPDIR, TMP, |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
540 " or TEMP is defined. To simplify testing, convert the string value into a |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
541 " list. |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
542 let bsklist = split(&bsk, ',') |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
543 |
13664
f64c5e636c9f
patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents:
11380
diff
changeset
|
544 if has("mac") |
15685
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
545 let found = (index(bsklist, '/private/tmp/*') >= 0) |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
546 call assert_true(found, '/private/tmp not in option bsk: ' . &bsk) |
13664
f64c5e636c9f
patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents:
11380
diff
changeset
|
547 elseif has("unix") |
15685
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
548 let found = (index(bsklist, '/tmp/*') >= 0) |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
549 call assert_true(found, '/tmp not in option bsk: ' . &bsk) |
13664
f64c5e636c9f
patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents:
11380
diff
changeset
|
550 endif |
f64c5e636c9f
patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents:
11380
diff
changeset
|
551 |
15685
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
552 " If our test platform is Windows, the path(s) in option bsk will use |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
553 " backslash for the path separator and the components could be in short |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
554 " (8.3) format. As such, we need to replace the backslashes with forward |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
555 " slashes and convert the path components to long format. The expand() |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
556 " function will do this but it cannot handle comma-separated paths. This is |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
557 " why bsk was converted from a string into a list of strings above. |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
558 " |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
559 " One final complication is that the wildcard "/*" is at the end of each |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
560 " path and so expand() might return a list of matching files. To prevent |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
561 " this, we need to remove the wildcard before calling expand() and then |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
562 " append it afterwards. |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
563 if has('win32') |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
564 let item_nbr = 0 |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
565 while item_nbr < len(bsklist) |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
566 let path_spec = bsklist[item_nbr] |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
567 let path_spec = strcharpart(path_spec, 0, strlen(path_spec)-2) |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
568 let path_spec = substitute(expand(path_spec), '\\', '/', 'g') |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
569 let bsklist[item_nbr] = path_spec . '/*' |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
570 let item_nbr += 1 |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
571 endwhile |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
572 endif |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
573 |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
574 " Option bsk will also include these environment variables if defined. |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
575 " If they're defined, verify they appear in the option value. |
e472308af17d
patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
576 for var in ['$TMPDIR', '$TMP', '$TEMP'] |
13664
f64c5e636c9f
patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents:
11380
diff
changeset
|
577 if exists(var) |
f64c5e636c9f
patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents:
11380
diff
changeset
|
578 let varvalue = substitute(expand(var), '\\', '/', 'g') |
15691
a8ed064ed316
patch 8.1.0853: options test fails on Mac
Bram Moolenaar <Bram@vim.org>
parents:
15685
diff
changeset
|
579 let varvalue = substitute(varvalue, '/$', '', '') |
a8ed064ed316
patch 8.1.0853: options test fails on Mac
Bram Moolenaar <Bram@vim.org>
parents:
15685
diff
changeset
|
580 let varvalue .= '/*' |
a8ed064ed316
patch 8.1.0853: options test fails on Mac
Bram Moolenaar <Bram@vim.org>
parents:
15685
diff
changeset
|
581 let found = (index(bsklist, varvalue) >= 0) |
a8ed064ed316
patch 8.1.0853: options test fails on Mac
Bram Moolenaar <Bram@vim.org>
parents:
15685
diff
changeset
|
582 call assert_true(found, var . ' (' . varvalue . ') not in option bsk: ' . &bsk) |
13664
f64c5e636c9f
patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents:
11380
diff
changeset
|
583 endif |
f64c5e636c9f
patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents:
11380
diff
changeset
|
584 endfor |
17039
d726d8cce996
patch 8.1.1519: 'backupskip' may contain duplicates
Bram Moolenaar <Bram@vim.org>
parents:
16722
diff
changeset
|
585 |
d726d8cce996
patch 8.1.1519: 'backupskip' may contain duplicates
Bram Moolenaar <Bram@vim.org>
parents:
16722
diff
changeset
|
586 " Duplicates should be filtered out (option has P_NODUP) |
d726d8cce996
patch 8.1.1519: 'backupskip' may contain duplicates
Bram Moolenaar <Bram@vim.org>
parents:
16722
diff
changeset
|
587 let backupskip = &backupskip |
d726d8cce996
patch 8.1.1519: 'backupskip' may contain duplicates
Bram Moolenaar <Bram@vim.org>
parents:
16722
diff
changeset
|
588 set backupskip= |
d726d8cce996
patch 8.1.1519: 'backupskip' may contain duplicates
Bram Moolenaar <Bram@vim.org>
parents:
16722
diff
changeset
|
589 set backupskip+=/test/dir |
d726d8cce996
patch 8.1.1519: 'backupskip' may contain duplicates
Bram Moolenaar <Bram@vim.org>
parents:
16722
diff
changeset
|
590 set backupskip+=/other/dir |
d726d8cce996
patch 8.1.1519: 'backupskip' may contain duplicates
Bram Moolenaar <Bram@vim.org>
parents:
16722
diff
changeset
|
591 set backupskip+=/test/dir |
d726d8cce996
patch 8.1.1519: 'backupskip' may contain duplicates
Bram Moolenaar <Bram@vim.org>
parents:
16722
diff
changeset
|
592 call assert_equal('/test/dir,/other/dir', &backupskip) |
d726d8cce996
patch 8.1.1519: 'backupskip' may contain duplicates
Bram Moolenaar <Bram@vim.org>
parents:
16722
diff
changeset
|
593 let &backupskip = backupskip |
13664
f64c5e636c9f
patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents:
11380
diff
changeset
|
594 endfunc |
13931
fc03fabbedc5
patch 8.0.1836: buffer-local window options may not be recent
Christian Brabandt <cb@256bit.org>
parents:
13872
diff
changeset
|
595 |
fc03fabbedc5
patch 8.0.1836: buffer-local window options may not be recent
Christian Brabandt <cb@256bit.org>
parents:
13872
diff
changeset
|
596 func Test_copy_winopt() |
14617
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
597 set hidden |
13931
fc03fabbedc5
patch 8.0.1836: buffer-local window options may not be recent
Christian Brabandt <cb@256bit.org>
parents:
13872
diff
changeset
|
598 |
14617
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
599 " Test copy option from current buffer in window |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
600 split |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
601 enew |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
602 setlocal numberwidth=5 |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
603 wincmd w |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
604 call assert_equal(4,&numberwidth) |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
605 bnext |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
606 call assert_equal(5,&numberwidth) |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
607 bw! |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
608 call assert_equal(4,&numberwidth) |
13931
fc03fabbedc5
patch 8.0.1836: buffer-local window options may not be recent
Christian Brabandt <cb@256bit.org>
parents:
13872
diff
changeset
|
609 |
14617
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
610 " Test copy value from window that used to be display the buffer |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
611 split |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
612 enew |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
613 setlocal numberwidth=6 |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
614 bnext |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
615 wincmd w |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
616 call assert_equal(4,&numberwidth) |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
617 bnext |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
618 call assert_equal(6,&numberwidth) |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
619 bw! |
13931
fc03fabbedc5
patch 8.0.1836: buffer-local window options may not be recent
Christian Brabandt <cb@256bit.org>
parents:
13872
diff
changeset
|
620 |
14617
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
621 " Test that if buffer is current, don't use the stale cached value |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
622 " from the last time the buffer was displayed. |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
623 split |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
624 enew |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
625 setlocal numberwidth=7 |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
626 bnext |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
627 bnext |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
628 setlocal numberwidth=8 |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
629 wincmd w |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
630 call assert_equal(4,&numberwidth) |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
631 bnext |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
632 call assert_equal(8,&numberwidth) |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
633 bw! |
13931
fc03fabbedc5
patch 8.0.1836: buffer-local window options may not be recent
Christian Brabandt <cb@256bit.org>
parents:
13872
diff
changeset
|
634 |
14617
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
635 " Test value is not copied if window already has seen the buffer |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
636 enew |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
637 split |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
638 setlocal numberwidth=9 |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
639 bnext |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
640 setlocal numberwidth=10 |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
641 wincmd w |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
642 call assert_equal(4,&numberwidth) |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
643 bnext |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
644 call assert_equal(4,&numberwidth) |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
645 bw! |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
646 |
56ceaa0ad239
patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents:
14593
diff
changeset
|
647 set hidden& |
13931
fc03fabbedc5
patch 8.0.1836: buffer-local window options may not be recent
Christian Brabandt <cb@256bit.org>
parents:
13872
diff
changeset
|
648 endfunc |
14185
20468fb49f9b
patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents:
13931
diff
changeset
|
649 |
20468fb49f9b
patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents:
13931
diff
changeset
|
650 func Test_shortmess_F() |
20468fb49f9b
patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents:
13931
diff
changeset
|
651 new |
20468fb49f9b
patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents:
13931
diff
changeset
|
652 call assert_match('\[No Name\]', execute('file')) |
20468fb49f9b
patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents:
13931
diff
changeset
|
653 set shortmess+=F |
20468fb49f9b
patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents:
13931
diff
changeset
|
654 call assert_match('\[No Name\]', execute('file')) |
20468fb49f9b
patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents:
13931
diff
changeset
|
655 call assert_match('^\s*$', execute('file foo')) |
20468fb49f9b
patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents:
13931
diff
changeset
|
656 call assert_match('foo', execute('file')) |
20468fb49f9b
patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents:
13931
diff
changeset
|
657 set shortmess-=F |
20468fb49f9b
patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents:
13931
diff
changeset
|
658 call assert_match('bar', execute('file bar')) |
20468fb49f9b
patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents:
13931
diff
changeset
|
659 call assert_match('bar', execute('file')) |
20468fb49f9b
patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents:
13931
diff
changeset
|
660 set shortmess& |
20468fb49f9b
patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents:
13931
diff
changeset
|
661 bwipe |
20468fb49f9b
patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents:
13931
diff
changeset
|
662 endfunc |
14593
b6b2f7d69c7f
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents:
14517
diff
changeset
|
663 |
b6b2f7d69c7f
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents:
14517
diff
changeset
|
664 func Test_shortmess_F2() |
b6b2f7d69c7f
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents:
14517
diff
changeset
|
665 e file1 |
b6b2f7d69c7f
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents:
14517
diff
changeset
|
666 e file2 |
b6b2f7d69c7f
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents:
14517
diff
changeset
|
667 call assert_match('file1', execute('bn', '')) |
b6b2f7d69c7f
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents:
14517
diff
changeset
|
668 call assert_match('file2', execute('bn', '')) |
b6b2f7d69c7f
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents:
14517
diff
changeset
|
669 set shortmess+=F |
b6b2f7d69c7f
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents:
14517
diff
changeset
|
670 call assert_true(empty(execute('bn', ''))) |
16664
ca1814eeecf5
patch 8.1.1334: when buffer is hidden "F" in 'shortmess' is not used
Bram Moolenaar <Bram@vim.org>
parents:
16206
diff
changeset
|
671 call assert_false(test_getvalue('need_fileinfo')) |
14593
b6b2f7d69c7f
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents:
14517
diff
changeset
|
672 call assert_true(empty(execute('bn', ''))) |
18031
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17657
diff
changeset
|
673 call assert_false('need_fileinfo'->test_getvalue()) |
14593
b6b2f7d69c7f
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents:
14517
diff
changeset
|
674 set hidden |
b6b2f7d69c7f
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents:
14517
diff
changeset
|
675 call assert_true(empty(execute('bn', ''))) |
16664
ca1814eeecf5
patch 8.1.1334: when buffer is hidden "F" in 'shortmess' is not used
Bram Moolenaar <Bram@vim.org>
parents:
16206
diff
changeset
|
676 call assert_false(test_getvalue('need_fileinfo')) |
14593
b6b2f7d69c7f
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents:
14517
diff
changeset
|
677 call assert_true(empty(execute('bn', ''))) |
16664
ca1814eeecf5
patch 8.1.1334: when buffer is hidden "F" in 'shortmess' is not used
Bram Moolenaar <Bram@vim.org>
parents:
16206
diff
changeset
|
678 call assert_false(test_getvalue('need_fileinfo')) |
14593
b6b2f7d69c7f
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents:
14517
diff
changeset
|
679 set nohidden |
b6b2f7d69c7f
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents:
14517
diff
changeset
|
680 call assert_true(empty(execute('bn', ''))) |
16664
ca1814eeecf5
patch 8.1.1334: when buffer is hidden "F" in 'shortmess' is not used
Bram Moolenaar <Bram@vim.org>
parents:
16206
diff
changeset
|
681 call assert_false(test_getvalue('need_fileinfo')) |
14593
b6b2f7d69c7f
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents:
14517
diff
changeset
|
682 call assert_true(empty(execute('bn', ''))) |
16664
ca1814eeecf5
patch 8.1.1334: when buffer is hidden "F" in 'shortmess' is not used
Bram Moolenaar <Bram@vim.org>
parents:
16206
diff
changeset
|
683 call assert_false(test_getvalue('need_fileinfo')) |
14593
b6b2f7d69c7f
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents:
14517
diff
changeset
|
684 set shortmess& |
b6b2f7d69c7f
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents:
14517
diff
changeset
|
685 call assert_match('file1', execute('bn', '')) |
b6b2f7d69c7f
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents:
14517
diff
changeset
|
686 call assert_match('file2', execute('bn', '')) |
b6b2f7d69c7f
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents:
14517
diff
changeset
|
687 bwipe |
b6b2f7d69c7f
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents:
14517
diff
changeset
|
688 bwipe |
b6b2f7d69c7f
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents:
14517
diff
changeset
|
689 endfunc |
15713
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
690 |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
691 func Test_local_scrolloff() |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
692 set so=5 |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
693 set siso=7 |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
694 split |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
695 call assert_equal(5, &so) |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
696 setlocal so=3 |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
697 call assert_equal(3, &so) |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
698 wincmd w |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
699 call assert_equal(5, &so) |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
700 wincmd w |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
701 setlocal so< |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
702 call assert_equal(5, &so) |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
703 setlocal so=0 |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
704 call assert_equal(0, &so) |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
705 setlocal so=-1 |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
706 call assert_equal(5, &so) |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
707 |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
708 call assert_equal(7, &siso) |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
709 setlocal siso=3 |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
710 call assert_equal(3, &siso) |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
711 wincmd w |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
712 call assert_equal(7, &siso) |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
713 wincmd w |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
714 setlocal siso< |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
715 call assert_equal(7, &siso) |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
716 setlocal siso=0 |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
717 call assert_equal(0, &siso) |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
718 setlocal siso=-1 |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
719 call assert_equal(7, &siso) |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
720 |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
721 close |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
722 set so& |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
723 set siso& |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15691
diff
changeset
|
724 endfunc |
16202
676069de7214
patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents:
15713
diff
changeset
|
725 |
676069de7214
patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents:
15713
diff
changeset
|
726 func Test_writedelay() |
19249
2a017e9dc6da
patch 8.2.0183: tests fail when the float feature is disabled
Bram Moolenaar <Bram@vim.org>
parents:
19231
diff
changeset
|
727 CheckFunction reltimefloat |
2a017e9dc6da
patch 8.2.0183: tests fail when the float feature is disabled
Bram Moolenaar <Bram@vim.org>
parents:
19231
diff
changeset
|
728 |
16202
676069de7214
patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents:
15713
diff
changeset
|
729 new |
676069de7214
patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents:
15713
diff
changeset
|
730 call setline(1, 'empty') |
676069de7214
patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents:
15713
diff
changeset
|
731 redraw |
676069de7214
patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents:
15713
diff
changeset
|
732 set writedelay=10 |
676069de7214
patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents:
15713
diff
changeset
|
733 let start = reltime() |
676069de7214
patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents:
15713
diff
changeset
|
734 call setline(1, repeat('x', 70)) |
676069de7214
patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents:
15713
diff
changeset
|
735 redraw |
676069de7214
patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents:
15713
diff
changeset
|
736 let elapsed = reltimefloat(reltime(start)) |
676069de7214
patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents:
15713
diff
changeset
|
737 set writedelay=0 |
676069de7214
patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents:
15713
diff
changeset
|
738 " With 'writedelay' set should take at least 30 * 10 msec |
676069de7214
patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents:
15713
diff
changeset
|
739 call assert_inrange(30 * 0.01, 999.0, elapsed) |
676069de7214
patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents:
15713
diff
changeset
|
740 |
676069de7214
patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents:
15713
diff
changeset
|
741 bwipe! |
676069de7214
patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents:
15713
diff
changeset
|
742 endfunc |
16204
e49b0957a0c7
patch 8.1.1107: no test for 'visualbell'
Bram Moolenaar <Bram@vim.org>
parents:
16202
diff
changeset
|
743 |
e49b0957a0c7
patch 8.1.1107: no test for 'visualbell'
Bram Moolenaar <Bram@vim.org>
parents:
16202
diff
changeset
|
744 func Test_visualbell() |
16206
d302c496e98b
patch 8.1.1108: test for 'visualbell' doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
16204
diff
changeset
|
745 set belloff= |
16204
e49b0957a0c7
patch 8.1.1107: no test for 'visualbell'
Bram Moolenaar <Bram@vim.org>
parents:
16202
diff
changeset
|
746 set visualbell |
e49b0957a0c7
patch 8.1.1107: no test for 'visualbell'
Bram Moolenaar <Bram@vim.org>
parents:
16202
diff
changeset
|
747 call assert_beeps('normal 0h') |
e49b0957a0c7
patch 8.1.1107: no test for 'visualbell'
Bram Moolenaar <Bram@vim.org>
parents:
16202
diff
changeset
|
748 set novisualbell |
16206
d302c496e98b
patch 8.1.1108: test for 'visualbell' doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
16204
diff
changeset
|
749 set belloff=all |
16204
e49b0957a0c7
patch 8.1.1107: no test for 'visualbell'
Bram Moolenaar <Bram@vim.org>
parents:
16202
diff
changeset
|
750 endfunc |
19231
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
19137
diff
changeset
|
751 |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
19137
diff
changeset
|
752 " Test for the 'write' option |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
19137
diff
changeset
|
753 func Test_write() |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
19137
diff
changeset
|
754 new |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
19137
diff
changeset
|
755 call setline(1, ['L1']) |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
19137
diff
changeset
|
756 set nowrite |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
19137
diff
changeset
|
757 call assert_fails('write Xfile', 'E142:') |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
19137
diff
changeset
|
758 set write |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
19137
diff
changeset
|
759 close! |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
19137
diff
changeset
|
760 endfunc |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
19137
diff
changeset
|
761 |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
19137
diff
changeset
|
762 " Test for 'buftype' option |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
19137
diff
changeset
|
763 func Test_buftype() |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
19137
diff
changeset
|
764 new |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
19137
diff
changeset
|
765 call setline(1, ['L1']) |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
19137
diff
changeset
|
766 set buftype=nowrite |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
19137
diff
changeset
|
767 call assert_fails('write', 'E382:') |
19693
9fbeb3bdf49e
patch 8.2.0403: when 'buftype' is "nofile" there is no overwrite check
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
768 |
9fbeb3bdf49e
patch 8.2.0403: when 'buftype' is "nofile" there is no overwrite check
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
769 for val in ['', 'nofile', 'nowrite', 'acwrite', 'quickfix', 'help', 'terminal', 'prompt', 'popup'] |
9fbeb3bdf49e
patch 8.2.0403: when 'buftype' is "nofile" there is no overwrite check
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
770 exe 'set buftype=' .. val |
9fbeb3bdf49e
patch 8.2.0403: when 'buftype' is "nofile" there is no overwrite check
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
771 call writefile(['something'], 'XBuftype') |
9fbeb3bdf49e
patch 8.2.0403: when 'buftype' is "nofile" there is no overwrite check
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
772 call assert_fails('write XBuftype', 'E13:', 'with buftype=' .. val) |
9fbeb3bdf49e
patch 8.2.0403: when 'buftype' is "nofile" there is no overwrite check
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
773 endfor |
9fbeb3bdf49e
patch 8.2.0403: when 'buftype' is "nofile" there is no overwrite check
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
774 |
9fbeb3bdf49e
patch 8.2.0403: when 'buftype' is "nofile" there is no overwrite check
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
775 call delete('XBuftype') |
9fbeb3bdf49e
patch 8.2.0403: when 'buftype' is "nofile" there is no overwrite check
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
776 bwipe! |
19231
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
19137
diff
changeset
|
777 endfunc |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
19137
diff
changeset
|
778 |
19958
0b42b5e50344
patch 8.2.0535: regexp patterns not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19932
diff
changeset
|
779 " Test for the 'shell' option |
0b42b5e50344
patch 8.2.0535: regexp patterns not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19932
diff
changeset
|
780 func Test_shell() |
0b42b5e50344
patch 8.2.0535: regexp patterns not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19932
diff
changeset
|
781 CheckUnix |
0b42b5e50344
patch 8.2.0535: regexp patterns not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19932
diff
changeset
|
782 let save_shell = &shell |
0b42b5e50344
patch 8.2.0535: regexp patterns not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19932
diff
changeset
|
783 set shell= |
0b42b5e50344
patch 8.2.0535: regexp patterns not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19932
diff
changeset
|
784 call assert_fails('shell', 'E91:') |
0b42b5e50344
patch 8.2.0535: regexp patterns not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19932
diff
changeset
|
785 let &shell = save_shell |
0b42b5e50344
patch 8.2.0535: regexp patterns not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19932
diff
changeset
|
786 endfunc |
0b42b5e50344
patch 8.2.0535: regexp patterns not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19932
diff
changeset
|
787 |
19277
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19249
diff
changeset
|
788 " Test for the 'shellquote' option |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19249
diff
changeset
|
789 func Test_shellquote() |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19249
diff
changeset
|
790 CheckUnix |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19249
diff
changeset
|
791 set shellquote=# |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19249
diff
changeset
|
792 set verbose=20 |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19249
diff
changeset
|
793 redir => v |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19249
diff
changeset
|
794 silent! !echo Hello |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19249
diff
changeset
|
795 redir END |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19249
diff
changeset
|
796 set verbose& |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19249
diff
changeset
|
797 set shellquote& |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19249
diff
changeset
|
798 call assert_match(': "#echo Hello#"', v) |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19249
diff
changeset
|
799 endfunc |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19249
diff
changeset
|
800 |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
801 " Test for the 'rightleftcmd' option |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
802 func Test_rightleftcmd() |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
803 CheckFeature rightleft |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
804 set rightleft |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
805 set rightleftcmd |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
806 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
807 let g:l = [] |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
808 func AddPos() |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
809 call add(g:l, screencol()) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
810 return '' |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
811 endfunc |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
812 cmap <expr> <F2> AddPos() |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
813 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
814 call feedkeys("/\<F2>abc\<Left>\<F2>\<Right>\<Right>\<F2>" .. |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
815 \ "\<Left>\<F2>\<Esc>", 'xt') |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
816 call assert_equal([&co - 1, &co - 4, &co - 2, &co - 3], g:l) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
817 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
818 cunmap <F2> |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
819 unlet g:l |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
820 set rightleftcmd& |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
821 set rightleft& |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
822 endfunc |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
823 |
19906
031184ace7c5
patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
824 " Test for the "debug" option |
031184ace7c5
patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
825 func Test_debug_option() |
031184ace7c5
patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
826 set debug=beep |
031184ace7c5
patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
827 exe "normal \<C-c>" |
031184ace7c5
patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
828 call assert_equal('Beep!', Screenline(&lines)) |
031184ace7c5
patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
829 set debug& |
031184ace7c5
patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
830 endfunc |
031184ace7c5
patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
831 |
19969
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
832 " Test for the default CDPATH option |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
833 func Test_opt_default_cdpath() |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
834 CheckFeature file_in_path |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
835 let after =<< trim [CODE] |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
836 call assert_equal(',/path/to/dir1,/path/to/dir2', &cdpath) |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
837 call writefile(v:errors, 'Xtestout') |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
838 qall |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
839 [CODE] |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
840 if has('unix') |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
841 let $CDPATH='/path/to/dir1:/path/to/dir2' |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
842 else |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
843 let $CDPATH='/path/to/dir1;/path/to/dir2' |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
844 endif |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
845 if RunVim([], after, '') |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
846 call assert_equal([], readfile('Xtestout')) |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
847 call delete('Xtestout') |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
848 endif |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
849 endfunc |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
850 |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
851 " Test for setting keycodes using set |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
852 func Test_opt_set_keycode() |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
853 call assert_fails('set <t_k1=l', 'E474:') |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
854 call assert_fails('set <Home=l', 'E474:') |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
855 set <t_k9>=abcd |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
856 call assert_equal('abcd', &t_k9) |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
857 set <t_k9>& |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
858 set <F9>=xyz |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
859 call assert_equal('xyz', &t_k9) |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
860 set <t_k9>& |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
861 endfunc |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
862 |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
863 " Test for changing options in a sandbox |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
864 func Test_opt_sandbox() |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
865 for opt in ['backupdir', 'cdpath', 'exrc'] |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
866 call assert_fails('sandbox set ' .. opt .. '?', 'E48:') |
19991
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
867 call assert_fails('sandbox let &' .. opt .. ' = 1', 'E48:') |
19969
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
868 endfor |
19991
f27473034f26
patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents:
19969
diff
changeset
|
869 call assert_fails('sandbox let &modelineexpr = 1', 'E48:') |
19969
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
870 endfunc |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
871 |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
872 " Test for setting an option with local value to global value |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
873 func Test_opt_local_to_global() |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
874 setglobal equalprg=gprg |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
875 setlocal equalprg=lprg |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
876 call assert_equal('gprg', &g:equalprg) |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
877 call assert_equal('lprg', &l:equalprg) |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
878 call assert_equal('lprg', &equalprg) |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
879 set equalprg< |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
880 call assert_equal('', &l:equalprg) |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
881 call assert_equal('gprg', &equalprg) |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
882 setglobal equalprg=gnewprg |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
883 setlocal equalprg=lnewprg |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
884 setlocal equalprg< |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
885 call assert_equal('gnewprg', &l:equalprg) |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
886 call assert_equal('gnewprg', &equalprg) |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
887 set equalprg& |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
888 endfunc |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
889 |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
890 " Test for incrementing, decrementing and multiplying a number option value |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
891 func Test_opt_num_op() |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
892 set shiftwidth=4 |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
893 set sw+=2 |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
894 call assert_equal(6, &sw) |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
895 set sw-=2 |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
896 call assert_equal(4, &sw) |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
897 set sw^=2 |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
898 call assert_equal(8, &sw) |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
899 set shiftwidth& |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
900 endfunc |
b07672d13ff9
patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents:
19958
diff
changeset
|
901 |
19231
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
19137
diff
changeset
|
902 " vim: shiftwidth=2 sts=2 expandtab |