annotate src/testdir/test_options.vim @ 31950:b0717fcca5eb v9.0.1307

patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors Commit: https://github.com/vim/vim/commit/32ff96ef018eb1a5bea0953648b4892a6ee71658 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Mon Feb 13 16:10:04 2023 +0000 patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors Problem: Setting 'formatoptions' with :let doesn't check for errors. Solution: Pass "errbuf" to set_string_option(). (Yegappan Lakshmanan, closes #11974, closes #11972)
author Bram Moolenaar <Bram@vim.org>
date Mon, 13 Feb 2023 17:15:04 +0100
parents 5a95f0c630b1
children ef124f222fc2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
22234
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
3 source shared.vim
17657
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17229
diff changeset
4 source check.vim
19906
031184ace7c5 patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
5 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
6
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14869
diff changeset
7 func Test_whichwrap()
9798
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 set whichwrap=b,s
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 call assert_equal('b,s', &whichwrap)
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 set whichwrap+=h,l
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 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
13
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 set whichwrap+=h,l
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 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
16
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 set whichwrap+=h,l
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 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
19
10831
e926c5a7f9bf patch 8.0.0305: invalid memory access when option has duplicate flag
Christian Brabandt <cb@256bit.org>
parents: 10823
diff changeset
20 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
21 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
22
e926c5a7f9bf patch 8.0.0305: invalid memory access when option has duplicate flag
Christian Brabandt <cb@256bit.org>
parents: 10823
diff changeset
23 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
24 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
25
19969
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
26 " 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
27 " supported for 'whichwrap'
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
28 set whichwrap=1
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
29 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
30 set whichwrap=2
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
31 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
32 set whichwrap=4
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
33 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
34 set whichwrap=8
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
35 call assert_equal('<,>', &whichwrap)
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
36 set whichwrap=16
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
37 call assert_equal('[,]', &whichwrap)
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
38 set whichwrap=31
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
39 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
40
9798
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 set whichwrap&
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14869
diff changeset
42 endfunc
9798
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14869
diff changeset
44 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
45 " 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
46 set isfname=
141fe140976c patch 8.0.0355: using uninitialized memory when 'isfname' is empty
Christian Brabandt <cb@256bit.org>
parents: 10906
diff changeset
47 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
48 set isfname&
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14869
diff changeset
49 endfunc
10932
141fe140976c patch 8.0.0355: using uninitialized memory when 'isfname' is empty
Christian Brabandt <cb@256bit.org>
parents: 10906
diff changeset
50
28800
fea88e555652 patch 8.2.4924: maparg() may return a string that cannot be reused
Bram Moolenaar <Bram@vim.org>
parents: 28786
diff changeset
51 " Test for getting the value of 'pastetoggle'
fea88e555652 patch 8.2.4924: maparg() may return a string that cannot be reused
Bram Moolenaar <Bram@vim.org>
parents: 28786
diff changeset
52 func Test_pastetoggle()
fea88e555652 patch 8.2.4924: maparg() may return a string that cannot be reused
Bram Moolenaar <Bram@vim.org>
parents: 28786
diff changeset
53 " character with K_SPECIAL byte
fea88e555652 patch 8.2.4924: maparg() may return a string that cannot be reused
Bram Moolenaar <Bram@vim.org>
parents: 28786
diff changeset
54 let &pastetoggle = '…'
fea88e555652 patch 8.2.4924: maparg() may return a string that cannot be reused
Bram Moolenaar <Bram@vim.org>
parents: 28786
diff changeset
55 call assert_equal('…', &pastetoggle)
fea88e555652 patch 8.2.4924: maparg() may return a string that cannot be reused
Bram Moolenaar <Bram@vim.org>
parents: 28786
diff changeset
56 call assert_equal("\n pastetoggle=…", execute('set pastetoggle?'))
fea88e555652 patch 8.2.4924: maparg() may return a string that cannot be reused
Bram Moolenaar <Bram@vim.org>
parents: 28786
diff changeset
57
fea88e555652 patch 8.2.4924: maparg() may return a string that cannot be reused
Bram Moolenaar <Bram@vim.org>
parents: 28786
diff changeset
58 " modified character with K_SPECIAL byte
fea88e555652 patch 8.2.4924: maparg() may return a string that cannot be reused
Bram Moolenaar <Bram@vim.org>
parents: 28786
diff changeset
59 let &pastetoggle = '<M-…>'
fea88e555652 patch 8.2.4924: maparg() may return a string that cannot be reused
Bram Moolenaar <Bram@vim.org>
parents: 28786
diff changeset
60 call assert_equal('<M-…>', &pastetoggle)
fea88e555652 patch 8.2.4924: maparg() may return a string that cannot be reused
Bram Moolenaar <Bram@vim.org>
parents: 28786
diff changeset
61 call assert_equal("\n pastetoggle=<M-…>", execute('set pastetoggle?'))
fea88e555652 patch 8.2.4924: maparg() may return a string that cannot be reused
Bram Moolenaar <Bram@vim.org>
parents: 28786
diff changeset
62
fea88e555652 patch 8.2.4924: maparg() may return a string that cannot be reused
Bram Moolenaar <Bram@vim.org>
parents: 28786
diff changeset
63 " illegal bytes
fea88e555652 patch 8.2.4924: maparg() may return a string that cannot be reused
Bram Moolenaar <Bram@vim.org>
parents: 28786
diff changeset
64 let str = ":\x7f:\x80:\x90:\xd0:"
fea88e555652 patch 8.2.4924: maparg() may return a string that cannot be reused
Bram Moolenaar <Bram@vim.org>
parents: 28786
diff changeset
65 let &pastetoggle = str
fea88e555652 patch 8.2.4924: maparg() may return a string that cannot be reused
Bram Moolenaar <Bram@vim.org>
parents: 28786
diff changeset
66 call assert_equal(str, &pastetoggle)
fea88e555652 patch 8.2.4924: maparg() may return a string that cannot be reused
Bram Moolenaar <Bram@vim.org>
parents: 28786
diff changeset
67 call assert_equal("\n pastetoggle=" .. strtrans(str), execute('set pastetoggle?'))
29434
5da38c4ffe92 patch 9.0.0059: test file has wrong name
Bram Moolenaar <Bram@vim.org>
parents: 29328
diff changeset
68
28800
fea88e555652 patch 8.2.4924: maparg() may return a string that cannot be reused
Bram Moolenaar <Bram@vim.org>
parents: 28786
diff changeset
69 unlet str
29434
5da38c4ffe92 patch 9.0.0059: test file has wrong name
Bram Moolenaar <Bram@vim.org>
parents: 29328
diff changeset
70 set pastetoggle&
28800
fea88e555652 patch 8.2.4924: maparg() may return a string that cannot be reused
Bram Moolenaar <Bram@vim.org>
parents: 28786
diff changeset
71 endfunc
fea88e555652 patch 8.2.4924: maparg() may return a string that cannot be reused
Bram Moolenaar <Bram@vim.org>
parents: 28786
diff changeset
72
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14869
diff changeset
73 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
74 " 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
75 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
76 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
77 set wildchar=<Esc>
6da4287fd735 patch 8.0.0370: invalid memory access when setting wildchar empty
Christian Brabandt <cb@256bit.org>
parents: 10958
diff changeset
78 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
79 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
80 set wildchar=27
6da4287fd735 patch 8.0.0370: invalid memory access when setting wildchar empty
Christian Brabandt <cb@256bit.org>
parents: 10958
diff changeset
81 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
82 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
83 set wildchar&
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14869
diff changeset
84 endfunc
10962
6da4287fd735 patch 8.0.0370: invalid memory access when setting wildchar empty
Christian Brabandt <cb@256bit.org>
parents: 10958
diff changeset
85
20512
33a67d1dcaf0 patch 8.2.0810: error when appending "tagfile" to 'wildoptions'
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
86 func Test_wildoptions()
33a67d1dcaf0 patch 8.2.0810: error when appending "tagfile" to 'wildoptions'
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
87 set wildoptions=
33a67d1dcaf0 patch 8.2.0810: error when appending "tagfile" to 'wildoptions'
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
88 set wildoptions+=tagfile
33a67d1dcaf0 patch 8.2.0810: error when appending "tagfile" to 'wildoptions'
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
89 set wildoptions+=tagfile
33a67d1dcaf0 patch 8.2.0810: error when appending "tagfile" to 'wildoptions'
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
90 call assert_equal('tagfile', &wildoptions)
33a67d1dcaf0 patch 8.2.0810: error when appending "tagfile" to 'wildoptions'
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
91 endfunc
33a67d1dcaf0 patch 8.2.0810: error when appending "tagfile" to 'wildoptions'
Bram Moolenaar <Bram@vim.org>
parents: 20313
diff changeset
92
19137
69f0e9b5c107 patch 8.2.0128: cannot list options one per line
Bram Moolenaar <Bram@vim.org>
parents: 18977
diff changeset
93 func Test_options_command()
9798
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
94 let caught = 'ok'
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
95 try
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
96 options
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
97 catch
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
98 let caught = v:throwpoint . "\n" . v:exception
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
99 endtry
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
100 call assert_equal('ok', caught)
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
101
16722
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
102 " 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
103 wincmd j
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
104 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
105 wincmd k
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
106 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
107 " 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
108 close
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
109
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
110 " 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
111 vert options
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
112 " 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
113 wincmd l
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
114 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
115 wincmd h
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
116 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
117 " 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
118 close
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
119
20043
d13f8ae3b1de patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents: 19991
diff changeset
120 " 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
121 set splitbelow
d13f8ae3b1de patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents: 19991
diff changeset
122 topleft options
d13f8ae3b1de patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents: 19991
diff changeset
123 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
124 close
d13f8ae3b1de patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents: 19991
diff changeset
125
d13f8ae3b1de patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents: 19991
diff changeset
126 " 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
127 set nosplitbelow
d13f8ae3b1de patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents: 19991
diff changeset
128 botright options
d13f8ae3b1de patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents: 19991
diff changeset
129 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
130 close
d13f8ae3b1de patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents: 19991
diff changeset
131 set splitbelow&
d13f8ae3b1de patch 8.2.0577: not all modifiers supported for :options
Bram Moolenaar <Bram@vim.org>
parents: 19991
diff changeset
132
16722
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
133 " 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
134 tab options
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
135 " 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
136 normal gT
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
137 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
138 normal gt
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
139 call assert_equal('option-window', bufname(''))
9798
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
140 " close option-window
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
141 close
19969
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
142
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
143 " 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
144 if has('browse')
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
145 browse set
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
146 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
147 close
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
148 endif
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14869
diff changeset
149 endfunc
9798
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
150
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14869
diff changeset
151 func Test_path_keep_commas()
9798
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
152 " Test that changing 'path' keeps two commas.
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
153 set path=foo,,bar
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
154 set path-=bar
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
155 set path+=bar
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
156 call assert_equal('foo,,bar', &path)
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
157
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
158 set path&
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14869
diff changeset
159 endfunc
9852
4eea48b76d03 commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents: 9798
diff changeset
160
26426
c59d60e21ef5 patch 8.2.3744: E854 is not tested; some spelling suggestions are not tested
Bram Moolenaar <Bram@vim.org>
parents: 26211
diff changeset
161 func Test_path_too_long()
c59d60e21ef5 patch 8.2.3744: E854 is not tested; some spelling suggestions are not tested
Bram Moolenaar <Bram@vim.org>
parents: 26211
diff changeset
162 exe 'set path=' .. repeat('x', 10000)
c59d60e21ef5 patch 8.2.3744: E854 is not tested; some spelling suggestions are not tested
Bram Moolenaar <Bram@vim.org>
parents: 26211
diff changeset
163 call assert_fails('find x', 'E854:')
c59d60e21ef5 patch 8.2.3744: E854 is not tested; some spelling suggestions are not tested
Bram Moolenaar <Bram@vim.org>
parents: 26211
diff changeset
164 set path&
c59d60e21ef5 patch 8.2.3744: E854 is not tested; some spelling suggestions are not tested
Bram Moolenaar <Bram@vim.org>
parents: 26211
diff changeset
165 endfunc
c59d60e21ef5 patch 8.2.3744: E854 is not tested; some spelling suggestions are not tested
Bram Moolenaar <Bram@vim.org>
parents: 26211
diff changeset
166
9852
4eea48b76d03 commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents: 9798
diff changeset
167 func Test_signcolumn()
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21672
diff changeset
168 CheckFeature signs
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21672
diff changeset
169 call assert_equal("auto", &signcolumn)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21672
diff changeset
170 set signcolumn=yes
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21672
diff changeset
171 set signcolumn=no
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21672
diff changeset
172 call assert_fails('set signcolumn=nope')
9852
4eea48b76d03 commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents: 9798
diff changeset
173 endfunc
4eea48b76d03 commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents: 9798
diff changeset
174
10322
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
175 func Test_filetype_valid()
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
176 set ft=valid_name
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
177 call assert_equal("valid_name", &filetype)
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
178 set ft=valid-name
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
179 call assert_equal("valid-name", &filetype)
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
180
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
181 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
182 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
183 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
184 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
185 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
186 call assert_equal("valid-name", &filetype)
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
187
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
188 exe "set ft=trunc\x00name"
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
189 call assert_equal("trunc", &filetype)
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
190 endfunc
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 func Test_syntax_valid()
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21672
diff changeset
193 CheckFeature syntax
10322
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
194 set syn=valid_name
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
195 call assert_equal("valid_name", &syntax)
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
196 set syn=valid-name
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
197 call assert_equal("valid-name", &syntax)
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
198
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
199 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
200 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
201 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
202 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
203 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
204 call assert_equal("valid-name", &syntax)
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
205
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
206 exe "set syn=trunc\x00name"
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
207 call assert_equal("trunc", &syntax)
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
208 endfunc
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
209
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
210 func Test_keymap_valid()
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21672
diff changeset
211 CheckFeature keymap
10322
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
212 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
213 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
214 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
215 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
216
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
217 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
218 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
219 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
220 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
221 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
222
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
223 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
224 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
225 endfunc
10416
ef5474130b0e commit https://github.com/vim/vim/commit/7554da4033498c4da0af3cde542c3e87e9097b73
Christian Brabandt <cb@256bit.org>
parents: 10324
diff changeset
226
10420
7a631c6b0a20 commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents: 10416
diff changeset
227 func Check_dir_option(name)
10416
ef5474130b0e commit https://github.com/vim/vim/commit/7554da4033498c4da0af3cde542c3e87e9097b73
Christian Brabandt <cb@256bit.org>
parents: 10324
diff changeset
228 " 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
229 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
230 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
231 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
232 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
233 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
234 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
235
ef5474130b0e commit https://github.com/vim/vim/commit/7554da4033498c4da0af3cde542c3e87e9097b73
Christian Brabandt <cb@256bit.org>
parents: 10324
diff changeset
236 " Check rejecting weird characters.
10420
7a631c6b0a20 commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents: 10416
diff changeset
237 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
238 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
239 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
240 endfunc
10420
7a631c6b0a20 commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents: 10416
diff changeset
241
10938
3b82ab325d59 patch 8.0.0358: invalid memory access in C-indent code
Christian Brabandt <cb@256bit.org>
parents: 10936
diff changeset
242 func Test_cinkeys()
3b82ab325d59 patch 8.0.0358: invalid memory access in C-indent code
Christian Brabandt <cb@256bit.org>
parents: 10936
diff changeset
243 " 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
244 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
245 norm a
3b82ab325d59 patch 8.0.0358: invalid memory access in C-indent code
Christian Brabandt <cb@256bit.org>
parents: 10936
diff changeset
246 set cindent& cinkeys&
3b82ab325d59 patch 8.0.0358: invalid memory access in C-indent code
Christian Brabandt <cb@256bit.org>
parents: 10936
diff changeset
247 endfunc
3b82ab325d59 patch 8.0.0358: invalid memory access in C-indent code
Christian Brabandt <cb@256bit.org>
parents: 10936
diff changeset
248
10420
7a631c6b0a20 commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents: 10416
diff changeset
249 func Test_dictionary()
7a631c6b0a20 commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents: 10416
diff changeset
250 call Check_dir_option('dictionary')
7a631c6b0a20 commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents: 10416
diff changeset
251 endfunc
7a631c6b0a20 commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents: 10416
diff changeset
252
7a631c6b0a20 commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents: 10416
diff changeset
253 func Test_thesaurus()
7a631c6b0a20 commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents: 10416
diff changeset
254 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
255 endfun
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
256
10887
40939b171432 patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Christian Brabandt <cb@256bit.org>
parents: 10831
diff changeset
257 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
258 " 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
259 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
260 new
40939b171432 patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Christian Brabandt <cb@256bit.org>
parents: 10831
diff changeset
261 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
262 bwipe!
19932
2c4d9ca33769 patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19906
diff changeset
263 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
264 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
265 endfun
40939b171432 patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Christian Brabandt <cb@256bit.org>
parents: 10831
diff changeset
266
10823
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
267 func Test_set_completion()
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
268 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
269 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
270
18977
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18973
diff changeset
271 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
272 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
273
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18973
diff changeset
274 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
275 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
276
30986
360f286b5869 patch 9.0.0828: various typos
Bram Moolenaar <Bram@vim.org>
parents: 30618
diff changeset
277 " Expand boolean options. When doing :set no<Tab>
10823
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
278 " 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
279 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
280 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
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 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
283 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
284
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
285 " Expand abbreviation of options.
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
286 call feedkeys(":set ts\<C-A>\<C-B>\"\<CR>", 'tx')
25976
7b2e2b9617ee patch 8.2.3521: options completion test fails
Bram Moolenaar <Bram@vim.org>
parents: 25238
diff changeset
287 call assert_equal('"set tabstop thesaurus thesaurusfunc ttyscroll', @:)
10823
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
288
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
289 " Expand current value
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
290 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
291 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
292
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
293 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
294 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
295
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
296 " Expand key codes.
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
297 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
298 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
299
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
300 " Expand terminal options.
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
301 call feedkeys(":set t_A\<C-A>\<C-B>\"\<CR>", 'tx')
20619
68c206d3a251 patch 8.2.0863: cannot set a separate color for underline/undercurl
Bram Moolenaar <Bram@vim.org>
parents: 20512
diff changeset
302 call assert_equal('"set t_AB t_AF t_AU t_AL', @:)
20313
244eb8d8d100 patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 20148
diff changeset
303 call assert_fails('call feedkeys(":set <t_afoo>=\<C-A>\<CR>", "xt")', 'E474:')
10823
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
304
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
305 " Expand directories.
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
306 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
307 call assert_match(' ./samples/ ', @:)
21779
30bdd2e4a6f9 patch 8.2.1439: tiny and small builds have no test coverage
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
308 call assert_notmatch(' ./summarize.vim ', @:)
10823
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
309
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
310 " Expand files and directories.
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
311 call feedkeys(":set tags=./\<C-A>\<C-B>\"\<CR>", 'tx')
21779
30bdd2e4a6f9 patch 8.2.1439: tiny and small builds have no test coverage
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
312 call assert_match(' ./samples/.* ./summarize.vim', @:)
10823
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
313
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
314 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
315 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
316 set tags&
18977
5bef1043abff patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18973
diff changeset
317
19991
f27473034f26 patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents: 19969
diff changeset
318 " 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
319 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
320 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
321
f27473034f26 patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents: 19969
diff changeset
322 " 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
323 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
324 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
325
f27473034f26 patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents: 19969
diff changeset
326 " 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
327 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
328 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
329
f27473034f26 patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents: 19969
diff changeset
330 " 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
331 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
332 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
333
f27473034f26 patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents: 19969
diff changeset
334 " 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
335 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
336 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
337
f27473034f26 patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents: 19969
diff changeset
338 " 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
339 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
340 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
341
f27473034f26 patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents: 19969
diff changeset
342 " 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
343 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
344 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
345
f27473034f26 patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents: 19969
diff changeset
346 " 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
347 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
348 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
349
f27473034f26 patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents: 19969
diff changeset
350 " 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
351 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
352 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
353
f27473034f26 patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents: 19969
diff changeset
354 " 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
355 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
356 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
357
f27473034f26 patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents: 19969
diff changeset
358 " 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
359 set key=abcd
f27473034f26 patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents: 19969
diff changeset
360 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
361 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
362 set key=
23821
bfc1ae959d9d patch 8.2.2452: no completion for the 'filetype' option
Bram Moolenaar <Bram@vim.org>
parents: 23810
diff changeset
363
bfc1ae959d9d patch 8.2.2452: no completion for the 'filetype' option
Bram Moolenaar <Bram@vim.org>
parents: 23810
diff changeset
364 " Expand values for 'filetype'
bfc1ae959d9d patch 8.2.2452: no completion for the 'filetype' option
Bram Moolenaar <Bram@vim.org>
parents: 23810
diff changeset
365 call feedkeys(":set filetype=sshdconfi\<Tab>\<C-B>\"\<CR>", 'xt')
bfc1ae959d9d patch 8.2.2452: no completion for the 'filetype' option
Bram Moolenaar <Bram@vim.org>
parents: 23810
diff changeset
366 call assert_equal('"set filetype=sshdconfig', @:)
bfc1ae959d9d patch 8.2.2452: no completion for the 'filetype' option
Bram Moolenaar <Bram@vim.org>
parents: 23810
diff changeset
367 call feedkeys(":set filetype=a\<C-A>\<C-B>\"\<CR>", 'xt')
bfc1ae959d9d patch 8.2.2452: no completion for the 'filetype' option
Bram Moolenaar <Bram@vim.org>
parents: 23810
diff changeset
368 call assert_equal('"set filetype=' .. getcompletion('a*', 'filetype')->join(), @:)
10420
7a631c6b0a20 commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents: 10416
diff changeset
369 endfunc
10823
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
370
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
371 func Test_set_errors()
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 scroll=-1', 'E49:')
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
373 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
374 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
375 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
376 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
377 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
378 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
379 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
380 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
381 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
382 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
383 if has('conceal')
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
384 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
385 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
386 endif
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
387 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
388 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
389 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
390 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
391 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
392 call assert_fails('set tabstop=-1', 'E487:')
27434
c1702fd7e716 patch 8.2.4245: ":retab 0" may cause illegal memory access
Bram Moolenaar <Bram@vim.org>
parents: 26500
diff changeset
393 call assert_fails('set tabstop=10000', 'E474:')
27934
c8d6c2736796 patch 8.2.4492: no error if an option is given a value with ":let &opt = val"
Bram Moolenaar <Bram@vim.org>
parents: 27827
diff changeset
394 call assert_fails('let &tabstop = 10000', 'E474:')
27434
c1702fd7e716 patch 8.2.4245: ":retab 0" may cause illegal memory access
Bram Moolenaar <Bram@vim.org>
parents: 26500
diff changeset
395 call assert_fails('set tabstop=5500000000', 'E474:')
10823
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 textwidth=-1', 'E487:')
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
397 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
398 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
399 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
400 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
401 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
402 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
403 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
404 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
405 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
406 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
407 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
408 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
409 call assert_fails('set commentstring=x', 'E537:')
27934
c8d6c2736796 patch 8.2.4492: no error if an option is given a value with ":let &opt = val"
Bram Moolenaar <Bram@vim.org>
parents: 27827
diff changeset
410 call assert_fails('let &commentstring = "x"', 'E537:')
10823
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
411 call assert_fails('set complete=x', 'E539:')
23652
2a5b9801f2e2 patch 8.2.2368: insufficient tests for setting options
Bram Moolenaar <Bram@vim.org>
parents: 23386
diff changeset
412 call assert_fails('set rulerformat=%-', 'E539:')
2a5b9801f2e2 patch 8.2.2368: insufficient tests for setting options
Bram Moolenaar <Bram@vim.org>
parents: 23386
diff changeset
413 call assert_fails('set rulerformat=%(', 'E542:')
2a5b9801f2e2 patch 8.2.2368: insufficient tests for setting options
Bram Moolenaar <Bram@vim.org>
parents: 23386
diff changeset
414 call assert_fails('set rulerformat=%15(%%', 'E542:')
2a5b9801f2e2 patch 8.2.2368: insufficient tests for setting options
Bram Moolenaar <Bram@vim.org>
parents: 23386
diff changeset
415 call assert_fails('set statusline=%$', 'E539:')
10823
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
416 call assert_fails('set statusline=%{', 'E540:')
28455
8f4f16efeeb3 patch 8.2.4752: wrong 'statusline' value can cause illegal memory access
Bram Moolenaar <Bram@vim.org>
parents: 27934
diff changeset
417 call assert_fails('set statusline=%{%', 'E540:')
8f4f16efeeb3 patch 8.2.4752: wrong 'statusline' value can cause illegal memory access
Bram Moolenaar <Bram@vim.org>
parents: 27934
diff changeset
418 call assert_fails('set statusline=%{%}', 'E539:')
10823
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
419 call assert_fails('set statusline=%(', 'E542:')
23652
2a5b9801f2e2 patch 8.2.2368: insufficient tests for setting options
Bram Moolenaar <Bram@vim.org>
parents: 23386
diff changeset
420 call assert_fails('set statusline=%)', 'E542:')
28455
8f4f16efeeb3 patch 8.2.4752: wrong 'statusline' value can cause illegal memory access
Bram Moolenaar <Bram@vim.org>
parents: 27934
diff changeset
421 call assert_fails('set tabline=%$', 'E539:')
8f4f16efeeb3 patch 8.2.4752: wrong 'statusline' value can cause illegal memory access
Bram Moolenaar <Bram@vim.org>
parents: 27934
diff changeset
422 call assert_fails('set tabline=%{', 'E540:')
8f4f16efeeb3 patch 8.2.4752: wrong 'statusline' value can cause illegal memory access
Bram Moolenaar <Bram@vim.org>
parents: 27934
diff changeset
423 call assert_fails('set tabline=%{%', 'E540:')
8f4f16efeeb3 patch 8.2.4752: wrong 'statusline' value can cause illegal memory access
Bram Moolenaar <Bram@vim.org>
parents: 27934
diff changeset
424 call assert_fails('set tabline=%{%}', 'E539:')
8f4f16efeeb3 patch 8.2.4752: wrong 'statusline' value can cause illegal memory access
Bram Moolenaar <Bram@vim.org>
parents: 27934
diff changeset
425 call assert_fails('set tabline=%(', 'E542:')
8f4f16efeeb3 patch 8.2.4752: wrong 'statusline' value can cause illegal memory access
Bram Moolenaar <Bram@vim.org>
parents: 27934
diff changeset
426 call assert_fails('set tabline=%)', 'E542:')
23652
2a5b9801f2e2 patch 8.2.2368: insufficient tests for setting options
Bram Moolenaar <Bram@vim.org>
parents: 23386
diff changeset
427
10936
a516b6c279d9 patch 8.0.0357: crash when setting 'guicursor' to weird value
Christian Brabandt <cb@256bit.org>
parents: 10932
diff changeset
428 if has('cursorshape')
a516b6c279d9 patch 8.0.0357: crash when setting 'guicursor' to weird value
Christian Brabandt <cb@256bit.org>
parents: 10932
diff changeset
429 " 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
430 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
431 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
432 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
433 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
434 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
435 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
436 endif
19740
a653d1a165ef patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19693
diff changeset
437 if has('mouseshape')
a653d1a165ef patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19693
diff changeset
438 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
439 endif
10823
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
440 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
441 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
442 set winminheight& winheight&
f27473034f26 patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents: 19969
diff changeset
443 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
444 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
445 set winminheight& winheight&
10823
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
446 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
447 set winminwidth& winwidth&
f27473034f26 patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents: 19969
diff changeset
448 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
449 set winwidth& winminwidth&
10823
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
450 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
451 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
452 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
453 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
454 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
455 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
456 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
457 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
458 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
459 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
460 call assert_fails('set invcmdheight', 'E474:')
23652
2a5b9801f2e2 patch 8.2.2368: insufficient tests for setting options
Bram Moolenaar <Bram@vim.org>
parents: 23386
diff changeset
461 if has('python') || has('python3')
19969
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
462 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
463 endif
19991
f27473034f26 patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents: 19969
diff changeset
464 call assert_fails("let &tabstop='ab'", 'E521:')
22375
595ea7f099cd patch 8.2.1736: failure to compile a pattern not tested much
Bram Moolenaar <Bram@vim.org>
parents: 22234
diff changeset
465 call assert_fails('set spellcapcheck=%\\(', 'E54:')
23652
2a5b9801f2e2 patch 8.2.2368: insufficient tests for setting options
Bram Moolenaar <Bram@vim.org>
parents: 23386
diff changeset
466 call assert_fails('set sessionoptions=curdir,sesdir', 'E474:')
2a5b9801f2e2 patch 8.2.2368: insufficient tests for setting options
Bram Moolenaar <Bram@vim.org>
parents: 23386
diff changeset
467 call assert_fails('set foldmarker={{{,', 'E474:')
2a5b9801f2e2 patch 8.2.2368: insufficient tests for setting options
Bram Moolenaar <Bram@vim.org>
parents: 23386
diff changeset
468 call assert_fails('set sessionoptions=sesdir,curdir', 'E474:')
29672
6b8aaf16af99 patch 9.0.0176: checking character options is duplicated and incomplete
Bram Moolenaar <Bram@vim.org>
parents: 29434
diff changeset
469 setlocal listchars=trail:·
6b8aaf16af99 patch 9.0.0176: checking character options is duplicated and incomplete
Bram Moolenaar <Bram@vim.org>
parents: 29434
diff changeset
470 call assert_fails('set ambiwidth=double', 'E834:')
6b8aaf16af99 patch 9.0.0176: checking character options is duplicated and incomplete
Bram Moolenaar <Bram@vim.org>
parents: 29434
diff changeset
471 setlocal listchars=trail:-
6b8aaf16af99 patch 9.0.0176: checking character options is duplicated and incomplete
Bram Moolenaar <Bram@vim.org>
parents: 29434
diff changeset
472 setglobal listchars=trail:·
6b8aaf16af99 patch 9.0.0176: checking character options is duplicated and incomplete
Bram Moolenaar <Bram@vim.org>
parents: 29434
diff changeset
473 call assert_fails('set ambiwidth=double', 'E834:')
23652
2a5b9801f2e2 patch 8.2.2368: insufficient tests for setting options
Bram Moolenaar <Bram@vim.org>
parents: 23386
diff changeset
474 set listchars&
29672
6b8aaf16af99 patch 9.0.0176: checking character options is duplicated and incomplete
Bram Moolenaar <Bram@vim.org>
parents: 29434
diff changeset
475 setlocal fillchars=stl:·
6b8aaf16af99 patch 9.0.0176: checking character options is duplicated and incomplete
Bram Moolenaar <Bram@vim.org>
parents: 29434
diff changeset
476 call assert_fails('set ambiwidth=double', 'E835:')
6b8aaf16af99 patch 9.0.0176: checking character options is duplicated and incomplete
Bram Moolenaar <Bram@vim.org>
parents: 29434
diff changeset
477 setlocal fillchars=stl:-
6b8aaf16af99 patch 9.0.0176: checking character options is duplicated and incomplete
Bram Moolenaar <Bram@vim.org>
parents: 29434
diff changeset
478 setglobal fillchars=stl:·
6b8aaf16af99 patch 9.0.0176: checking character options is duplicated and incomplete
Bram Moolenaar <Bram@vim.org>
parents: 29434
diff changeset
479 call assert_fails('set ambiwidth=double', 'E835:')
23652
2a5b9801f2e2 patch 8.2.2368: insufficient tests for setting options
Bram Moolenaar <Bram@vim.org>
parents: 23386
diff changeset
480 set fillchars&
2a5b9801f2e2 patch 8.2.2368: insufficient tests for setting options
Bram Moolenaar <Bram@vim.org>
parents: 23386
diff changeset
481 call assert_fails('set fileencoding=latin1,utf-8', 'E474:')
2a5b9801f2e2 patch 8.2.2368: insufficient tests for setting options
Bram Moolenaar <Bram@vim.org>
parents: 23386
diff changeset
482 set nomodifiable
2a5b9801f2e2 patch 8.2.2368: insufficient tests for setting options
Bram Moolenaar <Bram@vim.org>
parents: 23386
diff changeset
483 call assert_fails('set fileencoding=latin1', 'E21:')
2a5b9801f2e2 patch 8.2.2368: insufficient tests for setting options
Bram Moolenaar <Bram@vim.org>
parents: 23386
diff changeset
484 set modifiable&
24882
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
485 call assert_fails('set t_#-&', 'E522:')
31950
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
486 call assert_fails('let &formatoptions = "?"', 'E539:')
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
487 call assert_fails('call setbufvar("", "&formatoptions", "?")', 'E539:')
10823
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
488 endfunc
10906
7fc1df5536c9 patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents: 10887
diff changeset
489
27827
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
490 func Test_set_encoding()
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
491 let save_encoding = &encoding
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
492
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
493 set enc=iso8859-1
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
494 call assert_equal('latin1', &enc)
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
495 set enc=iso8859_1
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
496 call assert_equal('latin1', &enc)
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
497 set enc=iso-8859-1
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
498 call assert_equal('latin1', &enc)
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
499 set enc=iso_8859_1
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
500 call assert_equal('latin1', &enc)
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
501 set enc=iso88591
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
502 call assert_equal('latin1', &enc)
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
503 set enc=iso8859
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
504 call assert_equal('latin1', &enc)
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
505 set enc=iso-8859
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
506 call assert_equal('latin1', &enc)
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
507 set enc=iso_8859
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
508 call assert_equal('latin1', &enc)
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
509 call assert_fails('set enc=iso8858', 'E474:')
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
510 call assert_equal('latin1', &enc)
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
511
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
512 let &encoding = save_encoding
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
513 endfunc
0a0ad6453e67 patch 8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-"
Bram Moolenaar <Bram@vim.org>
parents: 27434
diff changeset
514
18380
212284f893d5 patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
515 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
516 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
517 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
518 endfunc
212284f893d5 patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
519 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
520 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
521 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
522 endfunc
212284f893d5 patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
523
14867
cf4d6489c9eb patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents: 14617
diff changeset
524 " 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
525 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
526 CheckNotGui
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17229
diff changeset
527
18380
212284f893d5 patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
528 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
529
cf4d6489c9eb patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents: 14617
diff changeset
530 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
531 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
532 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
533 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
534 endfunc
cf4d6489c9eb patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents: 14617
diff changeset
535
18380
212284f893d5 patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
536 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
537 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
538 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
539 split
212284f893d5 patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
540 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
541 quit
212284f893d5 patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
542 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
543
212284f893d5 patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
544 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
545 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
546 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
547 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
548 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
549 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
550
212284f893d5 patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
551 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
552 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
553 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
554 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
555 endfunc
212284f893d5 patch 8.1.2184: option context is not copied when splitting a window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
556
10906
7fc1df5536c9 patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents: 10887
diff changeset
557 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
558 CheckUnix
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17229
diff changeset
559 CheckNotGui
11348
4e5191165707 patch 8.0.0559: setting ttytype to xxx does not always fail
Christian Brabandt <cb@256bit.org>
parents: 11081
diff changeset
560
17657
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17229
diff changeset
561 " 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
562 " 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
563 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
564 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
565 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
566 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
567 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
568 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
569 try
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17229
diff changeset
570 set ttytype=
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17229
diff changeset
571 call assert_report('set ttytype= did not fail')
23810
8152b7daebad patch 8.2.2446: setting 'term' empty has different error if compiled with GUI
Bram Moolenaar <Bram@vim.org>
parents: 23652
diff changeset
572 catch /E529/
17657
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17229
diff changeset
573 endtry
11348
4e5191165707 patch 8.0.0559: setting ttytype to xxx does not always fail
Christian Brabandt <cb@256bit.org>
parents: 11081
diff changeset
574
17657
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17229
diff changeset
575 " 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
576 " 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
577 try
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17229
diff changeset
578 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
579 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
580 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
581 endtry
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17229
diff changeset
582
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17229
diff changeset
583 set ttytype&
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17229
diff changeset
584 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
585
2c4d9ca33769 patch 8.2.0522: several errors are not tested for
Bram Moolenaar <Bram@vim.org>
parents: 19906
diff changeset
586 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
587 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
588 endif
10906
7fc1df5536c9 patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents: 10887
diff changeset
589 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
590
e5896de85dcf patch 8.0.0368: not all options are tested with a range of values
Christian Brabandt <cb@256bit.org>
parents: 10938
diff changeset
591 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
592 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
593 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
594 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
595 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
596 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
597 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
598 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
599 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
600 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
601
19137
69f0e9b5c107 patch 8.2.0128: cannot list options one per line
Bram Moolenaar <Bram@vim.org>
parents: 18977
diff changeset
602 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
603 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
604 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
605 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
606 endfunc
69f0e9b5c107 patch 8.2.0128: cannot list options one per line
Bram Moolenaar <Bram@vim.org>
parents: 18977
diff changeset
607
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
608 func Test_set_values()
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
609 " opt_test.vim is generated from ../optiondefs.h using gen_opt_test.vim
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
610 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
611 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
612 else
bbdb4f0134cb patch 8.0.0429: options test does not always test everything
Christian Brabandt <cb@256bit.org>
parents: 10962
diff changeset
613 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
614 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
615 endfunc
11380
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
616
18973
bf8eb950df61 patch 8.2.0047: cannot skip tests for specific MS-Windows platform
Bram Moolenaar <Bram@vim.org>
parents: 18380
diff changeset
617 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
618 " 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
619 " 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
620 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
621 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
622 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
623 endif
bf8eb950df61 patch 8.2.0047: cannot skip tests for specific MS-Windows platform
Bram Moolenaar <Bram@vim.org>
parents: 18380
diff changeset
624 endfunc
bf8eb950df61 patch 8.2.0047: cannot skip tests for specific MS-Windows platform
Bram Moolenaar <Bram@vim.org>
parents: 18380
diff changeset
625
11380
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
626 func ResetIndentexpr()
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
627 set indentexpr=
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
628 endfunc
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
629
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
630 func Test_set_indentexpr()
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
631 " 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
632 set indentexpr=ResetIndentexpr()
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
633 new
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
634 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
635 call assert_equal('', &indentexpr)
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
636 bwipe!
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
637 endfunc
13664
f64c5e636c9f patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents: 11380
diff changeset
638
f64c5e636c9f patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents: 11380
diff changeset
639 func Test_backupskip()
15685
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
640 " 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
641 " 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
642 " 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
643 " list.
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
644 let bsklist = split(&bsk, ',')
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
645
13664
f64c5e636c9f patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents: 11380
diff changeset
646 if has("mac")
15685
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
647 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
648 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
649 elseif has("unix")
15685
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
650 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
651 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
652 endif
f64c5e636c9f patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents: 11380
diff changeset
653
15685
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
654 " 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
655 " 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
656 " (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
657 " 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
658 " 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
659 " 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
660 "
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
661 " 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
662 " 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
663 " 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
664 " append it afterwards.
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
665 if has('win32')
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
666 let item_nbr = 0
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
667 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
668 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
669 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
670 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
671 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
672 let item_nbr += 1
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
673 endwhile
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
674 endif
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
675
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
676 " 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
677 " 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
678 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
679 if exists(var)
f64c5e636c9f patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents: 11380
diff changeset
680 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
681 let varvalue = substitute(varvalue, '/$', '', '')
a8ed064ed316 patch 8.1.0853: options test fails on Mac
Bram Moolenaar <Bram@vim.org>
parents: 15685
diff changeset
682 let varvalue .= '/*'
a8ed064ed316 patch 8.1.0853: options test fails on Mac
Bram Moolenaar <Bram@vim.org>
parents: 15685
diff changeset
683 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
684 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
685 endif
f64c5e636c9f patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents: 11380
diff changeset
686 endfor
17039
d726d8cce996 patch 8.1.1519: 'backupskip' may contain duplicates
Bram Moolenaar <Bram@vim.org>
parents: 16722
diff changeset
687
22234
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
688 " Duplicates from environment variables should be filtered out (option has
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
689 " P_NODUP). Run this in a separate instance and write v:errors in a file,
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
690 " so that we see what happens on startup.
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
691 let after =<< trim [CODE]
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
692 let bsklist = split(&backupskip, ',')
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
693 call assert_equal(uniq(copy(bsklist)), bsklist)
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
694 call writefile(['errors:'] + v:errors, 'Xtestout')
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
695 qall
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
696 [CODE]
30592
457ea0570b6f patch 9.0.0631: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents: 30417
diff changeset
697 call writefile(after, 'Xafter', 'D')
22234
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
698 let cmd = GetVimProg() . ' --not-a-term -S Xafter --cmd "set enc=utf8"'
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
699
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
700 let saveenv = {}
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
701 for var in ['TMPDIR', 'TMP', 'TEMP']
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
702 let saveenv[var] = getenv(var)
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
703 call setenv(var, '/duplicate/path')
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
704 endfor
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
705
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
706 exe 'silent !' . cmd
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
707 call assert_equal(['errors:'], readfile('Xtestout'))
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
708
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
709 " restore environment variables
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
710 for var in ['TMPDIR', 'TMP', 'TEMP']
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
711 call setenv(var, saveenv[var])
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
712 endfor
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
713
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
714 call delete('Xtestout')
b5abb88d5700 patch 8.2.1666: the initial value of 'backupskip' can have duplicate items
Bram Moolenaar <Bram@vim.org>
parents: 21779
diff changeset
715
17039
d726d8cce996 patch 8.1.1519: 'backupskip' may contain duplicates
Bram Moolenaar <Bram@vim.org>
parents: 16722
diff changeset
716 " 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
717 let backupskip = &backupskip
d726d8cce996 patch 8.1.1519: 'backupskip' may contain duplicates
Bram Moolenaar <Bram@vim.org>
parents: 16722
diff changeset
718 set backupskip=
d726d8cce996 patch 8.1.1519: 'backupskip' may contain duplicates
Bram Moolenaar <Bram@vim.org>
parents: 16722
diff changeset
719 set backupskip+=/test/dir
d726d8cce996 patch 8.1.1519: 'backupskip' may contain duplicates
Bram Moolenaar <Bram@vim.org>
parents: 16722
diff changeset
720 set backupskip+=/other/dir
d726d8cce996 patch 8.1.1519: 'backupskip' may contain duplicates
Bram Moolenaar <Bram@vim.org>
parents: 16722
diff changeset
721 set backupskip+=/test/dir
d726d8cce996 patch 8.1.1519: 'backupskip' may contain duplicates
Bram Moolenaar <Bram@vim.org>
parents: 16722
diff changeset
722 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
723 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
724 endfunc
13931
fc03fabbedc5 patch 8.0.1836: buffer-local window options may not be recent
Christian Brabandt <cb@256bit.org>
parents: 13872
diff changeset
725
30618
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
726 func Test_buf_copy_winopt()
14617
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
727 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
728
14617
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
729 " 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
730 split
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
731 enew
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
732 setlocal numberwidth=5
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
733 wincmd w
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
734 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
735 bnext
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
736 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
737 bw!
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
738 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
739
14617
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
740 " 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
741 split
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
742 enew
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
743 setlocal numberwidth=6
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
744 bnext
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
745 wincmd w
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
746 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
747 bnext
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
748 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
749 bw!
13931
fc03fabbedc5 patch 8.0.1836: buffer-local window options may not be recent
Christian Brabandt <cb@256bit.org>
parents: 13872
diff changeset
750
14617
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
751 " 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
752 " 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
753 split
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
754 enew
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
755 setlocal numberwidth=7
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
756 bnext
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
757 bnext
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
758 setlocal numberwidth=8
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
759 wincmd w
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
760 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
761 bnext
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
762 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
763 bw!
13931
fc03fabbedc5 patch 8.0.1836: buffer-local window options may not be recent
Christian Brabandt <cb@256bit.org>
parents: 13872
diff changeset
764
14617
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
765 " 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
766 enew
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
767 split
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
768 setlocal numberwidth=9
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
769 bnext
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
770 setlocal numberwidth=10
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
771 wincmd w
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
772 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
773 bnext
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
774 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
775 bw!
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
776
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
777 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
778 endfunc
14185
20468fb49f9b patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents: 13931
diff changeset
779
30618
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
780 def Test_split_copy_options()
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
781 var values = [
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
782 ['cursorbind', true, false],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
783 ['fillchars', '"vert:-"', '"' .. &fillchars .. '"'],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
784 ['list', true, 0],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
785 ['listchars', '"space:-"', '"' .. &listchars .. '"'],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
786 ['number', true, 0],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
787 ['relativenumber', true, false],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
788 ['scrollbind', true, false],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
789 ['smoothscroll', true, false],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
790 ['virtualedit', '"block"', '"' .. &virtualedit .. '"'],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
791 ['wincolor', '"Search"', '"' .. &wincolor .. '"'],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
792 ['wrap', false, true],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
793 ]
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
794 if has('linebreak')
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
795 values += [
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
796 ['breakindent', true, false],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
797 ['breakindentopt', '"min:5"', '"' .. &breakindentopt .. '"'],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
798 ['linebreak', true, false],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
799 ['numberwidth', 7, 4],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
800 ['showbreak', '"++"', '"' .. &showbreak .. '"'],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
801 ]
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
802 endif
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
803 if has('rightleft')
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
804 values += [
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
805 ['rightleft', true, false],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
806 ['rightleftcmd', '"search"', '"' .. &rightleftcmd .. '"'],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
807 ]
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
808 endif
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
809 if has('statusline')
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
810 values += [
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
811 ['statusline', '"---%f---"', '"' .. &statusline .. '"'],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
812 ]
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
813 endif
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
814 if has('spell')
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
815 values += [
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
816 ['spell', true, false],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
817 ]
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
818 endif
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
819 if has('syntax')
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
820 values += [
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
821 ['cursorcolumn', true, false],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
822 ['cursorline', true, false],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
823 ['cursorlineopt', '"screenline"', '"' .. &cursorlineopt .. '"'],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
824 ['colorcolumn', '"+1"', '"' .. &colorcolumn .. '"'],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
825 ]
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
826 endif
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
827 if has('diff')
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
828 values += [
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
829 ['diff', true, false],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
830 ]
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
831 endif
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
832 if has('conceal')
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
833 values += [
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
834 ['concealcursor', '"nv"', '"' .. &concealcursor .. '"'],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
835 ['conceallevel', '3', &conceallevel],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
836 ]
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
837 endif
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
838 if has('terminal')
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
839 values += [
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
840 ['termwinkey', '"<C-X>"', '"' .. &termwinkey .. '"'],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
841 ['termwinsize', '"10x20"', '"' .. &termwinsize .. '"'],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
842 ]
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
843 endif
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
844 if has('folding')
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
845 values += [
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
846 ['foldcolumn', 5, &foldcolumn],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
847 ['foldenable', false, true],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
848 ['foldexpr', '"2 + 3"', '"' .. &foldexpr .. '"'],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
849 ['foldignore', '"+="', '"' .. &foldignore .. '"'],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
850 ['foldlevel', 4, &foldlevel],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
851 ['foldmarker', '">>,<<"', '"' .. &foldmarker .. '"'],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
852 ['foldmethod', '"marker"', '"' .. &foldmethod .. '"'],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
853 ['foldminlines', 3, &foldminlines],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
854 ['foldnestmax', 17, &foldnestmax],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
855 ['foldtext', '"closed"', '"' .. &foldtext .. '"'],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
856 ]
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
857 endif
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
858 if has('signs')
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
859 values += [
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
860 ['signcolumn', '"number"', '"' .. &signcolumn .. '"'],
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
861 ]
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
862 endif
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
863
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
864 # set options to non-default value
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
865 for item in values
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
866 exe $'&l:{item[0]} = {item[1]}'
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
867 endfor
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
868
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
869 # check values are set in new window
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
870 split
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
871 for item in values
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
872 exe $'assert_equal({item[1]}, &{item[0]}, "{item[0]}")'
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
873 endfor
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
874
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
875 # restore
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
876 close
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
877 for item in values
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
878 exe $'&l:{item[0]} = {item[2]}'
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
879 endfor
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
880 enddef
c2031ad5ed54 patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Bram Moolenaar <Bram@vim.org>
parents: 30592
diff changeset
881
14185
20468fb49f9b patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents: 13931
diff changeset
882 func Test_shortmess_F()
20468fb49f9b patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents: 13931
diff changeset
883 new
20468fb49f9b patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents: 13931
diff changeset
884 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
885 set shortmess+=F
20468fb49f9b patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents: 13931
diff changeset
886 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
887 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
888 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
889 set shortmess-=F
20468fb49f9b patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents: 13931
diff changeset
890 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
891 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
892 set shortmess&
20468fb49f9b patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents: 13931
diff changeset
893 bwipe
20468fb49f9b patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents: 13931
diff changeset
894 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
895
b6b2f7d69c7f patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents: 14517
diff changeset
896 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
897 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
898 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
899 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
900 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
901 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
902 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
903 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
904 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
905 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
906 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
907 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
908 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
909 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
910 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
911 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
912 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
913 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
914 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
915 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
916 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
917 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
918 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
919 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
920 bwipe
30415
56e38195570b patch 9.0.0543: insufficient testing for assert and test functions
Bram Moolenaar <Bram@vim.org>
parents: 30051
diff changeset
921 call assert_fails('call test_getvalue("abc")', 'E475:')
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
922 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
923
ad8b2c109b22 patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents: 15691
diff changeset
924 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
925 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
926 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
927 split
ad8b2c109b22 patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents: 15691
diff changeset
928 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
929 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
930 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
931 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
932 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
933 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
934 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
935 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
936 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
937 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
938 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
939 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
940
ad8b2c109b22 patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents: 15691
diff changeset
941 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
942 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
943 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
944 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
945 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
946 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
947 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
948 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
949 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
950 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
951 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
952 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
953
ad8b2c109b22 patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents: 15691
diff changeset
954 close
ad8b2c109b22 patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents: 15691
diff changeset
955 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
956 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
957 endfunc
16202
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
958
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
959 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
960 CheckFunction reltimefloat
2a017e9dc6da patch 8.2.0183: tests fail when the float feature is disabled
Bram Moolenaar <Bram@vim.org>
parents: 19231
diff changeset
961
16202
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
962 new
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
963 call setline(1, 'empty')
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
964 redraw
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
965 set writedelay=10
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
966 let start = reltime()
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
967 call setline(1, repeat('x', 70))
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
968 redraw
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
969 let elapsed = reltimefloat(reltime(start))
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
970 set writedelay=0
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
971 " 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
972 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
973
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
974 bwipe!
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
975 endfunc
16204
e49b0957a0c7 patch 8.1.1107: no test for 'visualbell'
Bram Moolenaar <Bram@vim.org>
parents: 16202
diff changeset
976
e49b0957a0c7 patch 8.1.1107: no test for 'visualbell'
Bram Moolenaar <Bram@vim.org>
parents: 16202
diff changeset
977 func Test_visualbell()
16206
d302c496e98b patch 8.1.1108: test for 'visualbell' doesn't work
Bram Moolenaar <Bram@vim.org>
parents: 16204
diff changeset
978 set belloff=
16204
e49b0957a0c7 patch 8.1.1107: no test for 'visualbell'
Bram Moolenaar <Bram@vim.org>
parents: 16202
diff changeset
979 set visualbell
e49b0957a0c7 patch 8.1.1107: no test for 'visualbell'
Bram Moolenaar <Bram@vim.org>
parents: 16202
diff changeset
980 call assert_beeps('normal 0h')
e49b0957a0c7 patch 8.1.1107: no test for 'visualbell'
Bram Moolenaar <Bram@vim.org>
parents: 16202
diff changeset
981 set novisualbell
16206
d302c496e98b patch 8.1.1108: test for 'visualbell' doesn't work
Bram Moolenaar <Bram@vim.org>
parents: 16204
diff changeset
982 set belloff=all
16204
e49b0957a0c7 patch 8.1.1107: no test for 'visualbell'
Bram Moolenaar <Bram@vim.org>
parents: 16202
diff changeset
983 endfunc
19231
b8fd7364befd patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 19137
diff changeset
984
b8fd7364befd patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 19137
diff changeset
985 " Test for the 'write' option
b8fd7364befd patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 19137
diff changeset
986 func Test_write()
b8fd7364befd patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 19137
diff changeset
987 new
b8fd7364befd patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 19137
diff changeset
988 call setline(1, ['L1'])
b8fd7364befd patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 19137
diff changeset
989 set nowrite
30051
13b02c1ea0f7 patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents: 29853
diff changeset
990 call assert_fails('write Xwrfile', 'E142:')
19231
b8fd7364befd patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 19137
diff changeset
991 set write
b8fd7364befd patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 19137
diff changeset
992 close!
b8fd7364befd patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 19137
diff changeset
993 endfunc
b8fd7364befd patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 19137
diff changeset
994
b8fd7364befd patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 19137
diff changeset
995 " Test for 'buftype' option
b8fd7364befd patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 19137
diff changeset
996 func Test_buftype()
b8fd7364befd patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 19137
diff changeset
997 new
b8fd7364befd patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 19137
diff changeset
998 call setline(1, ['L1'])
b8fd7364befd patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 19137
diff changeset
999 set buftype=nowrite
b8fd7364befd patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 19137
diff changeset
1000 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
1001
9fbeb3bdf49e patch 8.2.0403: when 'buftype' is "nofile" there is no overwrite check
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1002 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
1003 exe 'set buftype=' .. val
30592
457ea0570b6f patch 9.0.0631: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents: 30417
diff changeset
1004 call writefile(['something'], 'XBuftype', 'D')
19693
9fbeb3bdf49e patch 8.2.0403: when 'buftype' is "nofile" there is no overwrite check
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1005 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
1006 endfor
9fbeb3bdf49e patch 8.2.0403: when 'buftype' is "nofile" there is no overwrite check
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1007
9fbeb3bdf49e patch 8.2.0403: when 'buftype' is "nofile" there is no overwrite check
Bram Moolenaar <Bram@vim.org>
parents: 19536
diff changeset
1008 bwipe!
19231
b8fd7364befd patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 19137
diff changeset
1009 endfunc
b8fd7364befd patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 19137
diff changeset
1010
19536
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19277
diff changeset
1011 " 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
1012 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
1013 CheckFeature rightleft
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19277
diff changeset
1014 set rightleft
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19277
diff changeset
1015
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19277
diff changeset
1016 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
1017 func AddPos()
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19277
diff changeset
1018 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
1019 return ''
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19277
diff changeset
1020 endfunc
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19277
diff changeset
1021 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
1022
29434
5da38c4ffe92 patch 9.0.0059: test file has wrong name
Bram Moolenaar <Bram@vim.org>
parents: 29328
diff changeset
1023 set rightleftcmd=
5da38c4ffe92 patch 9.0.0059: test file has wrong name
Bram Moolenaar <Bram@vim.org>
parents: 29328
diff changeset
1024 call feedkeys("/\<F2>abc\<Right>\<F2>\<Left>\<Left>\<F2>" ..
5da38c4ffe92 patch 9.0.0059: test file has wrong name
Bram Moolenaar <Bram@vim.org>
parents: 29328
diff changeset
1025 \ "\<Right>\<F2>\<Esc>", 'xt')
5da38c4ffe92 patch 9.0.0059: test file has wrong name
Bram Moolenaar <Bram@vim.org>
parents: 29328
diff changeset
1026 call assert_equal([2, 5, 3, 4], g:l)
5da38c4ffe92 patch 9.0.0059: test file has wrong name
Bram Moolenaar <Bram@vim.org>
parents: 29328
diff changeset
1027
5da38c4ffe92 patch 9.0.0059: test file has wrong name
Bram Moolenaar <Bram@vim.org>
parents: 29328
diff changeset
1028 let g:l = []
5da38c4ffe92 patch 9.0.0059: test file has wrong name
Bram Moolenaar <Bram@vim.org>
parents: 29328
diff changeset
1029 set rightleftcmd=search
19536
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19277
diff changeset
1030 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
1031 \ "\<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
1032 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
1033
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19277
diff changeset
1034 cunmap <F2>
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19277
diff changeset
1035 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
1036 set rightleftcmd&
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19277
diff changeset
1037 set rightleft&
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19277
diff changeset
1038 endfunc
bab20768e1fd patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19277
diff changeset
1039
29734
2d2f36e430f9 patch 9.0.0207: stacktrace not shown when debugging
Bram Moolenaar <Bram@vim.org>
parents: 29672
diff changeset
1040 " Test for the 'debug' option
19906
031184ace7c5 patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
1041 func Test_debug_option()
29734
2d2f36e430f9 patch 9.0.0207: stacktrace not shown when debugging
Bram Moolenaar <Bram@vim.org>
parents: 29672
diff changeset
1042 " redraw to avoid matching previous messages
2d2f36e430f9 patch 9.0.0207: stacktrace not shown when debugging
Bram Moolenaar <Bram@vim.org>
parents: 29672
diff changeset
1043 redraw
19906
031184ace7c5 patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
1044 set debug=beep
031184ace7c5 patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
1045 exe "normal \<C-c>"
031184ace7c5 patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
1046 call assert_equal('Beep!', Screenline(&lines))
29734
2d2f36e430f9 patch 9.0.0207: stacktrace not shown when debugging
Bram Moolenaar <Bram@vim.org>
parents: 29672
diff changeset
1047 call assert_equal('line 4:', Screenline(&lines - 1))
2d2f36e430f9 patch 9.0.0207: stacktrace not shown when debugging
Bram Moolenaar <Bram@vim.org>
parents: 29672
diff changeset
1048 " only match the final colon in the line that shows the source
2d2f36e430f9 patch 9.0.0207: stacktrace not shown when debugging
Bram Moolenaar <Bram@vim.org>
parents: 29672
diff changeset
1049 call assert_match(':$', Screenline(&lines - 2))
19906
031184ace7c5 patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
1050 set debug&
031184ace7c5 patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
1051 endfunc
031184ace7c5 patch 8.2.0509: various code is not properly tested.
Bram Moolenaar <Bram@vim.org>
parents: 19752
diff changeset
1052
19969
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1053 " 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
1054 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
1055 let after =<< trim [CODE]
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1056 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
1057 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
1058 qall
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1059 [CODE]
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1060 if has('unix')
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1061 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
1062 else
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1063 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
1064 endif
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1065 if RunVim([], after, '')
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1066 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
1067 call delete('Xtestout')
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1068 endif
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1069 endfunc
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1070
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1071 " 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
1072 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
1073 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
1074 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
1075 set <t_k9>=abcd
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1076 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
1077 set <t_k9>&
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1078 set <F9>=xyz
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1079 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
1080 set <t_k9>&
29328
60977de70684 patch 9.0.0007: no support for double, dotted and dashed underlines
Bram Moolenaar <Bram@vim.org>
parents: 28839
diff changeset
1081
60977de70684 patch 9.0.0007: no support for double, dotted and dashed underlines
Bram Moolenaar <Bram@vim.org>
parents: 28839
diff changeset
1082 " should we test all of them?
60977de70684 patch 9.0.0007: no support for double, dotted and dashed underlines
Bram Moolenaar <Bram@vim.org>
parents: 28839
diff changeset
1083 set t_Ce=testCe
60977de70684 patch 9.0.0007: no support for double, dotted and dashed underlines
Bram Moolenaar <Bram@vim.org>
parents: 28839
diff changeset
1084 set t_Cs=testCs
60977de70684 patch 9.0.0007: no support for double, dotted and dashed underlines
Bram Moolenaar <Bram@vim.org>
parents: 28839
diff changeset
1085 set t_Us=testUs
60977de70684 patch 9.0.0007: no support for double, dotted and dashed underlines
Bram Moolenaar <Bram@vim.org>
parents: 28839
diff changeset
1086 set t_ds=testds
60977de70684 patch 9.0.0007: no support for double, dotted and dashed underlines
Bram Moolenaar <Bram@vim.org>
parents: 28839
diff changeset
1087 set t_Ds=testDs
60977de70684 patch 9.0.0007: no support for double, dotted and dashed underlines
Bram Moolenaar <Bram@vim.org>
parents: 28839
diff changeset
1088 call assert_equal('testCe', &t_Ce)
60977de70684 patch 9.0.0007: no support for double, dotted and dashed underlines
Bram Moolenaar <Bram@vim.org>
parents: 28839
diff changeset
1089 call assert_equal('testCs', &t_Cs)
60977de70684 patch 9.0.0007: no support for double, dotted and dashed underlines
Bram Moolenaar <Bram@vim.org>
parents: 28839
diff changeset
1090 call assert_equal('testUs', &t_Us)
60977de70684 patch 9.0.0007: no support for double, dotted and dashed underlines
Bram Moolenaar <Bram@vim.org>
parents: 28839
diff changeset
1091 call assert_equal('testds', &t_ds)
60977de70684 patch 9.0.0007: no support for double, dotted and dashed underlines
Bram Moolenaar <Bram@vim.org>
parents: 28839
diff changeset
1092 call assert_equal('testDs', &t_Ds)
19969
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1093 endfunc
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1094
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1095 " 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
1096 func Test_opt_sandbox()
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1097 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
1098 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
1099 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
1100 endfor
19991
f27473034f26 patch 8.2.0551: not all code for options is tested
Bram Moolenaar <Bram@vim.org>
parents: 19969
diff changeset
1101 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
1102 endfunc
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1103
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1104 " 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
1105 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
1106 setglobal equalprg=gprg
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1107 setlocal equalprg=lprg
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1108 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
1109 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
1110 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
1111 set equalprg<
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1112 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
1113 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
1114 setglobal equalprg=gnewprg
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1115 setlocal equalprg=lnewprg
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1116 setlocal equalprg<
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1117 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
1118 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
1119 set equalprg&
24882
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1120
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1121 " Test for setting the global/local value of a boolean option
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1122 setglobal autoread
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1123 setlocal noautoread
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1124 call assert_false(&autoread)
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1125 set autoread<
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1126 call assert_true(&autoread)
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1127 setglobal noautoread
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1128 setlocal autoread
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1129 setlocal autoread<
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1130 call assert_false(&autoread)
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1131 set autoread&
19969
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1132 endfunc
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1133
25238
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1134 func Test_set_in_sandbox()
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1135 " Some boolean options cannot be set in sandbox, some can.
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1136 call assert_fails('sandbox set modelineexpr', 'E48:')
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1137 sandbox set number
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1138 call assert_true(&number)
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1139 set number&
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1140
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1141 " Some boolean options cannot be set in sandbox, some can.
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1142 if has('python') || has('python3')
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1143 call assert_fails('sandbox set pyxversion=3', 'E48:')
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1144 endif
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1145 sandbox set tabstop=4
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1146 call assert_equal(4, &tabstop)
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1147 set tabstop&
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1148
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1149 " Some string options cannot be set in sandbox, some can.
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1150 call assert_fails('sandbox set backupdir=/tmp', 'E48:')
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1151 sandbox set filetype=perl
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1152 call assert_equal('perl', &filetype)
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1153 set filetype&
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1154 endfunc
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1155
19969
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1156 " 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
1157 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
1158 set shiftwidth=4
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1159 set sw+=2
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1160 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
1161 set sw-=2
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1162 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
1163 set sw^=2
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1164 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
1165 set shiftwidth&
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1166 endfunc
b07672d13ff9 patch 8.2.0540: regexp and other code not tested
Bram Moolenaar <Bram@vim.org>
parents: 19958
diff changeset
1167
20148
fadb7f84beff patch 8.2.0629: setting a boolean option to v:false does not work
Bram Moolenaar <Bram@vim.org>
parents: 20043
diff changeset
1168 " Test for setting option values using v:false and v:true
fadb7f84beff patch 8.2.0629: setting a boolean option to v:false does not work
Bram Moolenaar <Bram@vim.org>
parents: 20043
diff changeset
1169 func Test_opt_boolean()
fadb7f84beff patch 8.2.0629: setting a boolean option to v:false does not work
Bram Moolenaar <Bram@vim.org>
parents: 20043
diff changeset
1170 set number&
fadb7f84beff patch 8.2.0629: setting a boolean option to v:false does not work
Bram Moolenaar <Bram@vim.org>
parents: 20043
diff changeset
1171 set number
fadb7f84beff patch 8.2.0629: setting a boolean option to v:false does not work
Bram Moolenaar <Bram@vim.org>
parents: 20043
diff changeset
1172 call assert_equal(1, &nu)
fadb7f84beff patch 8.2.0629: setting a boolean option to v:false does not work
Bram Moolenaar <Bram@vim.org>
parents: 20043
diff changeset
1173 set nonu
fadb7f84beff patch 8.2.0629: setting a boolean option to v:false does not work
Bram Moolenaar <Bram@vim.org>
parents: 20043
diff changeset
1174 call assert_equal(0, &nu)
fadb7f84beff patch 8.2.0629: setting a boolean option to v:false does not work
Bram Moolenaar <Bram@vim.org>
parents: 20043
diff changeset
1175 let &nu = v:true
fadb7f84beff patch 8.2.0629: setting a boolean option to v:false does not work
Bram Moolenaar <Bram@vim.org>
parents: 20043
diff changeset
1176 call assert_equal(1, &nu)
fadb7f84beff patch 8.2.0629: setting a boolean option to v:false does not work
Bram Moolenaar <Bram@vim.org>
parents: 20043
diff changeset
1177 let &nu = v:false
fadb7f84beff patch 8.2.0629: setting a boolean option to v:false does not work
Bram Moolenaar <Bram@vim.org>
parents: 20043
diff changeset
1178 call assert_equal(0, &nu)
fadb7f84beff patch 8.2.0629: setting a boolean option to v:false does not work
Bram Moolenaar <Bram@vim.org>
parents: 20043
diff changeset
1179 set number&
fadb7f84beff patch 8.2.0629: setting a boolean option to v:false does not work
Bram Moolenaar <Bram@vim.org>
parents: 20043
diff changeset
1180 endfunc
fadb7f84beff patch 8.2.0629: setting a boolean option to v:false does not work
Bram Moolenaar <Bram@vim.org>
parents: 20043
diff changeset
1181
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1182 " Test for the 'window' option
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1183 func Test_window_opt()
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1184 " Needs only one open widow
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1185 %bw!
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1186 call setline(1, range(1, 8))
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1187 set window=5
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1188 exe "normal \<C-F>"
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1189 call assert_equal(4, line('w0'))
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1190 exe "normal \<C-F>"
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1191 call assert_equal(7, line('w0'))
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1192 exe "normal \<C-F>"
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1193 call assert_equal(8, line('w0'))
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1194 exe "normal \<C-B>"
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1195 call assert_equal(5, line('w0'))
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1196 exe "normal \<C-B>"
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1197 call assert_equal(2, line('w0'))
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1198 exe "normal \<C-B>"
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1199 call assert_equal(1, line('w0'))
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1200 set window=1
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1201 exe "normal gg\<C-F>"
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1202 call assert_equal(2, line('w0'))
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1203 exe "normal \<C-F>"
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1204 call assert_equal(3, line('w0'))
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1205 exe "normal \<C-B>"
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1206 call assert_equal(2, line('w0'))
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1207 exe "normal \<C-B>"
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1208 call assert_equal(1, line('w0'))
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1209 enew!
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1210 set window&
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1211 endfunc
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20619
diff changeset
1212
21020
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
1213 " Test for the 'winminheight' option
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
1214 func Test_opt_winminheight()
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
1215 only!
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
1216 let &winheight = &lines + 4
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
1217 call assert_fails('let &winminheight = &lines + 2', 'E36:')
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
1218 call assert_true(&winminheight <= &lines)
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
1219 set winminheight&
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
1220 set winheight&
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
1221 endfunc
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
1222
24037
b5a6de6a8915 patch 8.2.2560: setting 'winminheigt' does not take tabline into account
Bram Moolenaar <Bram@vim.org>
parents: 23821
diff changeset
1223 func Test_opt_winminheight_term()
b5a6de6a8915 patch 8.2.2560: setting 'winminheigt' does not take tabline into account
Bram Moolenaar <Bram@vim.org>
parents: 23821
diff changeset
1224 CheckRunVimInTerminal
b5a6de6a8915 patch 8.2.2560: setting 'winminheigt' does not take tabline into account
Bram Moolenaar <Bram@vim.org>
parents: 23821
diff changeset
1225
b5a6de6a8915 patch 8.2.2560: setting 'winminheigt' does not take tabline into account
Bram Moolenaar <Bram@vim.org>
parents: 23821
diff changeset
1226 " The tabline should be taken into account.
b5a6de6a8915 patch 8.2.2560: setting 'winminheigt' does not take tabline into account
Bram Moolenaar <Bram@vim.org>
parents: 23821
diff changeset
1227 let lines =<< trim END
b5a6de6a8915 patch 8.2.2560: setting 'winminheigt' does not take tabline into account
Bram Moolenaar <Bram@vim.org>
parents: 23821
diff changeset
1228 set wmh=0 stal=2
b5a6de6a8915 patch 8.2.2560: setting 'winminheigt' does not take tabline into account
Bram Moolenaar <Bram@vim.org>
parents: 23821
diff changeset
1229 below sp | wincmd _
b5a6de6a8915 patch 8.2.2560: setting 'winminheigt' does not take tabline into account
Bram Moolenaar <Bram@vim.org>
parents: 23821
diff changeset
1230 below sp | wincmd _
b5a6de6a8915 patch 8.2.2560: setting 'winminheigt' does not take tabline into account
Bram Moolenaar <Bram@vim.org>
parents: 23821
diff changeset
1231 below sp | wincmd _
b5a6de6a8915 patch 8.2.2560: setting 'winminheigt' does not take tabline into account
Bram Moolenaar <Bram@vim.org>
parents: 23821
diff changeset
1232 below sp
b5a6de6a8915 patch 8.2.2560: setting 'winminheigt' does not take tabline into account
Bram Moolenaar <Bram@vim.org>
parents: 23821
diff changeset
1233 END
30592
457ea0570b6f patch 9.0.0631: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents: 30417
diff changeset
1234 call writefile(lines, 'Xwinminheight', 'D')
24037
b5a6de6a8915 patch 8.2.2560: setting 'winminheigt' does not take tabline into account
Bram Moolenaar <Bram@vim.org>
parents: 23821
diff changeset
1235 let buf = RunVimInTerminal('-S Xwinminheight', #{rows: 11})
b5a6de6a8915 patch 8.2.2560: setting 'winminheigt' does not take tabline into account
Bram Moolenaar <Bram@vim.org>
parents: 23821
diff changeset
1236 call term_sendkeys(buf, ":set wmh=1\n")
b5a6de6a8915 patch 8.2.2560: setting 'winminheigt' does not take tabline into account
Bram Moolenaar <Bram@vim.org>
parents: 23821
diff changeset
1237 call WaitForAssert({-> assert_match('E36: Not enough room', term_getline(buf, 11))})
b5a6de6a8915 patch 8.2.2560: setting 'winminheigt' does not take tabline into account
Bram Moolenaar <Bram@vim.org>
parents: 23821
diff changeset
1238
b5a6de6a8915 patch 8.2.2560: setting 'winminheigt' does not take tabline into account
Bram Moolenaar <Bram@vim.org>
parents: 23821
diff changeset
1239 call StopVimInTerminal(buf)
b5a6de6a8915 patch 8.2.2560: setting 'winminheigt' does not take tabline into account
Bram Moolenaar <Bram@vim.org>
parents: 23821
diff changeset
1240 endfunc
b5a6de6a8915 patch 8.2.2560: setting 'winminheigt' does not take tabline into account
Bram Moolenaar <Bram@vim.org>
parents: 23821
diff changeset
1241
24108
0a5eba7e6660 patch 8.2.2595: setting 'winminheight' may cause 'lines' to change
Bram Moolenaar <Bram@vim.org>
parents: 24037
diff changeset
1242 func Test_opt_winminheight_term_tabs()
0a5eba7e6660 patch 8.2.2595: setting 'winminheight' may cause 'lines' to change
Bram Moolenaar <Bram@vim.org>
parents: 24037
diff changeset
1243 CheckRunVimInTerminal
0a5eba7e6660 patch 8.2.2595: setting 'winminheight' may cause 'lines' to change
Bram Moolenaar <Bram@vim.org>
parents: 24037
diff changeset
1244
0a5eba7e6660 patch 8.2.2595: setting 'winminheight' may cause 'lines' to change
Bram Moolenaar <Bram@vim.org>
parents: 24037
diff changeset
1245 " The tabline should be taken into account.
0a5eba7e6660 patch 8.2.2595: setting 'winminheight' may cause 'lines' to change
Bram Moolenaar <Bram@vim.org>
parents: 24037
diff changeset
1246 let lines =<< trim END
0a5eba7e6660 patch 8.2.2595: setting 'winminheight' may cause 'lines' to change
Bram Moolenaar <Bram@vim.org>
parents: 24037
diff changeset
1247 set wmh=0 stal=2
0a5eba7e6660 patch 8.2.2595: setting 'winminheight' may cause 'lines' to change
Bram Moolenaar <Bram@vim.org>
parents: 24037
diff changeset
1248 split
0a5eba7e6660 patch 8.2.2595: setting 'winminheight' may cause 'lines' to change
Bram Moolenaar <Bram@vim.org>
parents: 24037
diff changeset
1249 split
0a5eba7e6660 patch 8.2.2595: setting 'winminheight' may cause 'lines' to change
Bram Moolenaar <Bram@vim.org>
parents: 24037
diff changeset
1250 split
0a5eba7e6660 patch 8.2.2595: setting 'winminheight' may cause 'lines' to change
Bram Moolenaar <Bram@vim.org>
parents: 24037
diff changeset
1251 split
0a5eba7e6660 patch 8.2.2595: setting 'winminheight' may cause 'lines' to change
Bram Moolenaar <Bram@vim.org>
parents: 24037
diff changeset
1252 tabnew
0a5eba7e6660 patch 8.2.2595: setting 'winminheight' may cause 'lines' to change
Bram Moolenaar <Bram@vim.org>
parents: 24037
diff changeset
1253 END
30592
457ea0570b6f patch 9.0.0631: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents: 30417
diff changeset
1254 call writefile(lines, 'Xwinminheight', 'D')
24108
0a5eba7e6660 patch 8.2.2595: setting 'winminheight' may cause 'lines' to change
Bram Moolenaar <Bram@vim.org>
parents: 24037
diff changeset
1255 let buf = RunVimInTerminal('-S Xwinminheight', #{rows: 11})
0a5eba7e6660 patch 8.2.2595: setting 'winminheight' may cause 'lines' to change
Bram Moolenaar <Bram@vim.org>
parents: 24037
diff changeset
1256 call term_sendkeys(buf, ":set wmh=1\n")
0a5eba7e6660 patch 8.2.2595: setting 'winminheight' may cause 'lines' to change
Bram Moolenaar <Bram@vim.org>
parents: 24037
diff changeset
1257 call WaitForAssert({-> assert_match('E36: Not enough room', term_getline(buf, 11))})
0a5eba7e6660 patch 8.2.2595: setting 'winminheight' may cause 'lines' to change
Bram Moolenaar <Bram@vim.org>
parents: 24037
diff changeset
1258
0a5eba7e6660 patch 8.2.2595: setting 'winminheight' may cause 'lines' to change
Bram Moolenaar <Bram@vim.org>
parents: 24037
diff changeset
1259 call StopVimInTerminal(buf)
0a5eba7e6660 patch 8.2.2595: setting 'winminheight' may cause 'lines' to change
Bram Moolenaar <Bram@vim.org>
parents: 24037
diff changeset
1260 endfunc
0a5eba7e6660 patch 8.2.2595: setting 'winminheight' may cause 'lines' to change
Bram Moolenaar <Bram@vim.org>
parents: 24037
diff changeset
1261
21020
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
1262 " Test for the 'winminwidth' option
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
1263 func Test_opt_winminwidth()
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
1264 only!
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
1265 let &winwidth = &columns + 4
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
1266 call assert_fails('let &winminwidth = &columns + 2', 'E36:')
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
1267 call assert_true(&winminwidth <= &columns)
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
1268 set winminwidth&
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
1269 set winwidth&
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
1270 endfunc
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
1271
21672
9099eb378758 patch 8.2.1386: backslash not removed afer space with space in 'isfname'
Bram Moolenaar <Bram@vim.org>
parents: 21020
diff changeset
1272 " Test for setting option value containing spaces with isfname+=32
9099eb378758 patch 8.2.1386: backslash not removed afer space with space in 'isfname'
Bram Moolenaar <Bram@vim.org>
parents: 21020
diff changeset
1273 func Test_isfname_with_options()
9099eb378758 patch 8.2.1386: backslash not removed afer space with space in 'isfname'
Bram Moolenaar <Bram@vim.org>
parents: 21020
diff changeset
1274 set isfname+=32
9099eb378758 patch 8.2.1386: backslash not removed afer space with space in 'isfname'
Bram Moolenaar <Bram@vim.org>
parents: 21020
diff changeset
1275 setlocal keywordprg=:term\ help.exe
9099eb378758 patch 8.2.1386: backslash not removed afer space with space in 'isfname'
Bram Moolenaar <Bram@vim.org>
parents: 21020
diff changeset
1276 call assert_equal(':term help.exe', &keywordprg)
9099eb378758 patch 8.2.1386: backslash not removed afer space with space in 'isfname'
Bram Moolenaar <Bram@vim.org>
parents: 21020
diff changeset
1277 set isfname&
9099eb378758 patch 8.2.1386: backslash not removed afer space with space in 'isfname'
Bram Moolenaar <Bram@vim.org>
parents: 21020
diff changeset
1278 setlocal keywordprg&
9099eb378758 patch 8.2.1386: backslash not removed afer space with space in 'isfname'
Bram Moolenaar <Bram@vim.org>
parents: 21020
diff changeset
1279 endfunc
9099eb378758 patch 8.2.1386: backslash not removed afer space with space in 'isfname'
Bram Moolenaar <Bram@vim.org>
parents: 21020
diff changeset
1280
23386
3105546b941f patch 8.2.2236: 'scroll' option can change when setting the statusline
Bram Moolenaar <Bram@vim.org>
parents: 22967
diff changeset
1281 " Test that resetting laststatus does change scroll option
3105546b941f patch 8.2.2236: 'scroll' option can change when setting the statusline
Bram Moolenaar <Bram@vim.org>
parents: 22967
diff changeset
1282 func Test_opt_reset_scroll()
3105546b941f patch 8.2.2236: 'scroll' option can change when setting the statusline
Bram Moolenaar <Bram@vim.org>
parents: 22967
diff changeset
1283 CheckRunVimInTerminal
3105546b941f patch 8.2.2236: 'scroll' option can change when setting the statusline
Bram Moolenaar <Bram@vim.org>
parents: 22967
diff changeset
1284 let vimrc =<< trim [CODE]
3105546b941f patch 8.2.2236: 'scroll' option can change when setting the statusline
Bram Moolenaar <Bram@vim.org>
parents: 22967
diff changeset
1285 set scroll=2
3105546b941f patch 8.2.2236: 'scroll' option can change when setting the statusline
Bram Moolenaar <Bram@vim.org>
parents: 22967
diff changeset
1286 set laststatus=2
3105546b941f patch 8.2.2236: 'scroll' option can change when setting the statusline
Bram Moolenaar <Bram@vim.org>
parents: 22967
diff changeset
1287 [CODE]
30592
457ea0570b6f patch 9.0.0631: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents: 30417
diff changeset
1288 call writefile(vimrc, 'Xscroll', 'D')
23386
3105546b941f patch 8.2.2236: 'scroll' option can change when setting the statusline
Bram Moolenaar <Bram@vim.org>
parents: 22967
diff changeset
1289 let buf = RunVimInTerminal('-S Xscroll', {'rows': 16, 'cols': 45})
3105546b941f patch 8.2.2236: 'scroll' option can change when setting the statusline
Bram Moolenaar <Bram@vim.org>
parents: 22967
diff changeset
1290 call term_sendkeys(buf, ":verbose set scroll?\n")
3105546b941f patch 8.2.2236: 'scroll' option can change when setting the statusline
Bram Moolenaar <Bram@vim.org>
parents: 22967
diff changeset
1291 call WaitForAssert({-> assert_match('Last set.*window size', term_getline(buf, 15))})
3105546b941f patch 8.2.2236: 'scroll' option can change when setting the statusline
Bram Moolenaar <Bram@vim.org>
parents: 22967
diff changeset
1292 call assert_match('^\s*scroll=7$', term_getline(buf, 14))
3105546b941f patch 8.2.2236: 'scroll' option can change when setting the statusline
Bram Moolenaar <Bram@vim.org>
parents: 22967
diff changeset
1293
3105546b941f patch 8.2.2236: 'scroll' option can change when setting the statusline
Bram Moolenaar <Bram@vim.org>
parents: 22967
diff changeset
1294 " clean up
30592
457ea0570b6f patch 9.0.0631: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents: 30417
diff changeset
1295 call StopVimInTerminal(buf)
23386
3105546b941f patch 8.2.2236: 'scroll' option can change when setting the statusline
Bram Moolenaar <Bram@vim.org>
parents: 22967
diff changeset
1296 endfunc
3105546b941f patch 8.2.2236: 'scroll' option can change when setting the statusline
Bram Moolenaar <Bram@vim.org>
parents: 22967
diff changeset
1297
24596
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1298 " Check that VIM_POSIX env variable influences default value of 'cpo' and 'shm'
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1299 func Test_VIM_POSIX()
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1300 let saved_VIM_POSIX = getenv("VIM_POSIX")
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1301
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1302 call setenv('VIM_POSIX', "1")
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1303 let after =<< trim [CODE]
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1304 call writefile([&cpo, &shm], 'X_VIM_POSIX')
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1305 qall
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1306 [CODE]
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1307 if RunVim([], after, '')
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1308 call assert_equal(['aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZ$!%*-+<>#{|&/\.;',
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1309 \ 'AS'], readfile('X_VIM_POSIX'))
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1310 endif
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1311
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1312 call setenv('VIM_POSIX', v:null)
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1313 let after =<< trim [CODE]
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1314 call writefile([&cpo, &shm], 'X_VIM_POSIX')
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1315 qall
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1316 [CODE]
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1317 if RunVim([], after, '')
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1318 call assert_equal(['aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZ$!%*-+<>;',
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1319 \ 'S'], readfile('X_VIM_POSIX'))
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1320 endif
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1321
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1322 call delete('X_VIM_POSIX')
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1323 call setenv('VIM_POSIX', saved_VIM_POSIX)
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1324 endfunc
acd9220bdd0b patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24108
diff changeset
1325
24882
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1326 " Test for setting an option to a Vi or Vim default
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1327 func Test_opt_default()
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1328 set formatoptions&vi
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1329 call assert_equal('vt', &formatoptions)
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1330 set formatoptions&vim
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1331 call assert_equal('tcq', &formatoptions)
24912
02fa8d72e4e3 patch 8.2.2993: 'fileencodings' default value should depend on 'encoding'
Bram Moolenaar <Bram@vim.org>
parents: 24882
diff changeset
1332
02fa8d72e4e3 patch 8.2.2993: 'fileencodings' default value should depend on 'encoding'
Bram Moolenaar <Bram@vim.org>
parents: 24882
diff changeset
1333 call assert_equal('ucs-bom,utf-8,default,latin1', &fencs)
02fa8d72e4e3 patch 8.2.2993: 'fileencodings' default value should depend on 'encoding'
Bram Moolenaar <Bram@vim.org>
parents: 24882
diff changeset
1334 set fencs=latin1
02fa8d72e4e3 patch 8.2.2993: 'fileencodings' default value should depend on 'encoding'
Bram Moolenaar <Bram@vim.org>
parents: 24882
diff changeset
1335 set fencs&
02fa8d72e4e3 patch 8.2.2993: 'fileencodings' default value should depend on 'encoding'
Bram Moolenaar <Bram@vim.org>
parents: 24882
diff changeset
1336 call assert_equal('ucs-bom,utf-8,default,latin1', &fencs)
02fa8d72e4e3 patch 8.2.2993: 'fileencodings' default value should depend on 'encoding'
Bram Moolenaar <Bram@vim.org>
parents: 24882
diff changeset
1337 set fencs=latin1
02fa8d72e4e3 patch 8.2.2993: 'fileencodings' default value should depend on 'encoding'
Bram Moolenaar <Bram@vim.org>
parents: 24882
diff changeset
1338 set all&
02fa8d72e4e3 patch 8.2.2993: 'fileencodings' default value should depend on 'encoding'
Bram Moolenaar <Bram@vim.org>
parents: 24882
diff changeset
1339 call assert_equal('ucs-bom,utf-8,default,latin1', &fencs)
24882
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1340 endfunc
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1341
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1342 " Test for the 'cmdheight' option
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1343 func Test_cmdheight()
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1344 %bw!
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1345 let ht = &lines
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1346 set cmdheight=9999
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1347 call assert_equal(1, winheight(0))
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1348 call assert_equal(ht - 1, &cmdheight)
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1349 set cmdheight&
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1350 endfunc
4c1b6f3eb96b patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 24596
diff changeset
1351
26211
485c7c4afeb7 patch 8.2.3637: typos in test files
Bram Moolenaar <Bram@vim.org>
parents: 25976
diff changeset
1352 " To specify a control character as an option value, '^' can be used
24914
1186160ecf57 patch 8.2.2994: various code is not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 24912
diff changeset
1353 func Test_opt_control_char()
1186160ecf57 patch 8.2.2994: various code is not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 24912
diff changeset
1354 set wildchar=^v
1186160ecf57 patch 8.2.2994: various code is not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 24912
diff changeset
1355 call assert_equal("\<C-V>", nr2char(&wildchar))
1186160ecf57 patch 8.2.2994: various code is not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 24912
diff changeset
1356 set wildcharm=^r
1186160ecf57 patch 8.2.2994: various code is not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 24912
diff changeset
1357 call assert_equal("\<C-R>", nr2char(&wildcharm))
1186160ecf57 patch 8.2.2994: various code is not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 24912
diff changeset
1358 " Bug: This doesn't work for the 'cedit' and 'termwinkey' options
1186160ecf57 patch 8.2.2994: various code is not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 24912
diff changeset
1359 set wildchar& wildcharm&
1186160ecf57 patch 8.2.2994: various code is not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 24912
diff changeset
1360 endfunc
1186160ecf57 patch 8.2.2994: various code is not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 24912
diff changeset
1361
1186160ecf57 patch 8.2.2994: various code is not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 24912
diff changeset
1362 " Test for the 'errorbells' option
1186160ecf57 patch 8.2.2994: various code is not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 24912
diff changeset
1363 func Test_opt_errorbells()
1186160ecf57 patch 8.2.2994: various code is not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 24912
diff changeset
1364 set errorbells
1186160ecf57 patch 8.2.2994: various code is not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 24912
diff changeset
1365 call assert_beeps('s/a1b2/x1y2/')
1186160ecf57 patch 8.2.2994: various code is not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 24912
diff changeset
1366 set noerrorbells
1186160ecf57 patch 8.2.2994: various code is not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 24912
diff changeset
1367 endfunc
1186160ecf57 patch 8.2.2994: various code is not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 24912
diff changeset
1368
25238
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1369 func Test_opt_scrolljump()
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1370 help
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1371 resize 10
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1372
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1373 " Test with positive 'scrolljump'.
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1374 set scrolljump=2
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1375 norm! Lj
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1376 call assert_equal({'lnum':11, 'leftcol':0, 'col':0, 'topfill':0,
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1377 \ 'topline':3, 'coladd':0, 'skipcol':0, 'curswant':0},
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1378 \ winsaveview())
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1379
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1380 " Test with negative 'scrolljump' (percentage of window height).
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1381 set scrolljump=-40
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1382 norm! ggLj
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1383 call assert_equal({'lnum':11, 'leftcol':0, 'col':0, 'topfill':0,
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1384 \ 'topline':5, 'coladd':0, 'skipcol':0, 'curswant':0},
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1385 \ winsaveview())
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1386
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1387 set scrolljump&
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1388 bw
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1389 endfunc
dd98794f7d8c patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 25048
diff changeset
1390
26500
8088fa133b93 patch 8.2.3780: ":cd" works differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 26426
diff changeset
1391 " Test for the 'cdhome' option
8088fa133b93 patch 8.2.3780: ":cd" works differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 26426
diff changeset
1392 func Test_opt_cdhome()
8088fa133b93 patch 8.2.3780: ":cd" works differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 26426
diff changeset
1393 if has('unix') || has('vms')
8088fa133b93 patch 8.2.3780: ":cd" works differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 26426
diff changeset
1394 throw 'Skipped: only works on non-Unix'
8088fa133b93 patch 8.2.3780: ":cd" works differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 26426
diff changeset
1395 endif
8088fa133b93 patch 8.2.3780: ":cd" works differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 26426
diff changeset
1396
8088fa133b93 patch 8.2.3780: ":cd" works differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 26426
diff changeset
1397 set cdhome&
8088fa133b93 patch 8.2.3780: ":cd" works differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 26426
diff changeset
1398 call assert_equal(0, &cdhome)
8088fa133b93 patch 8.2.3780: ":cd" works differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 26426
diff changeset
1399 set cdhome
8088fa133b93 patch 8.2.3780: ":cd" works differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 26426
diff changeset
1400
8088fa133b93 patch 8.2.3780: ":cd" works differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 26426
diff changeset
1401 " This paragraph is copied from Test_cd_no_arg().
8088fa133b93 patch 8.2.3780: ":cd" works differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 26426
diff changeset
1402 let path = getcwd()
8088fa133b93 patch 8.2.3780: ":cd" works differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 26426
diff changeset
1403 cd
8088fa133b93 patch 8.2.3780: ":cd" works differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 26426
diff changeset
1404 call assert_equal($HOME, getcwd())
8088fa133b93 patch 8.2.3780: ":cd" works differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 26426
diff changeset
1405 call assert_notequal(path, getcwd())
8088fa133b93 patch 8.2.3780: ":cd" works differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 26426
diff changeset
1406 exe 'cd ' .. fnameescape(path)
8088fa133b93 patch 8.2.3780: ":cd" works differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 26426
diff changeset
1407 call assert_equal(path, getcwd())
8088fa133b93 patch 8.2.3780: ":cd" works differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 26426
diff changeset
1408
8088fa133b93 patch 8.2.3780: ":cd" works differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 26426
diff changeset
1409 set cdhome&
8088fa133b93 patch 8.2.3780: ":cd" works differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 26426
diff changeset
1410 endfunc
8088fa133b93 patch 8.2.3780: ":cd" works differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 26426
diff changeset
1411
28786
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1412 func Test_set_completion_2()
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1413 CheckOption termguicolors
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1414
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1415 " Test default option completion
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1416 set wildoptions=
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1417 call feedkeys(":set termg\<C-A>\<C-B>\"\<CR>", 'tx')
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1418 call assert_equal('"set termguicolors', @:)
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1419
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1420 call feedkeys(":set notermg\<C-A>\<C-B>\"\<CR>", 'tx')
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1421 call assert_equal('"set notermguicolors', @:)
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1422
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1423 " Test fuzzy option completion
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1424 set wildoptions=fuzzy
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1425 call feedkeys(":set termg\<C-A>\<C-B>\"\<CR>", 'tx')
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1426 call assert_equal('"set termguicolors termencoding', @:)
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1427
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1428 call feedkeys(":set notermg\<C-A>\<C-B>\"\<CR>", 'tx')
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1429 call assert_equal('"set notermguicolors', @:)
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1430
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1431 set wildoptions=
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1432 endfunc
fd5942a62312 patch 8.2.4917: fuzzy expansion of option names is not right
Bram Moolenaar <Bram@vim.org>
parents: 28455
diff changeset
1433
28839
b93668df9160 patch 8.2.4943: changing 'switchbuf' may have no effect
Bram Moolenaar <Bram@vim.org>
parents: 28800
diff changeset
1434 func Test_switchbuf_reset()
b93668df9160 patch 8.2.4943: changing 'switchbuf' may have no effect
Bram Moolenaar <Bram@vim.org>
parents: 28800
diff changeset
1435 set switchbuf=useopen
b93668df9160 patch 8.2.4943: changing 'switchbuf' may have no effect
Bram Moolenaar <Bram@vim.org>
parents: 28800
diff changeset
1436 sblast
b93668df9160 patch 8.2.4943: changing 'switchbuf' may have no effect
Bram Moolenaar <Bram@vim.org>
parents: 28800
diff changeset
1437 call assert_equal(1, winnr('$'))
b93668df9160 patch 8.2.4943: changing 'switchbuf' may have no effect
Bram Moolenaar <Bram@vim.org>
parents: 28800
diff changeset
1438 set all&
b93668df9160 patch 8.2.4943: changing 'switchbuf' may have no effect
Bram Moolenaar <Bram@vim.org>
parents: 28800
diff changeset
1439 call assert_equal('', &switchbuf)
b93668df9160 patch 8.2.4943: changing 'switchbuf' may have no effect
Bram Moolenaar <Bram@vim.org>
parents: 28800
diff changeset
1440 sblast
b93668df9160 patch 8.2.4943: changing 'switchbuf' may have no effect
Bram Moolenaar <Bram@vim.org>
parents: 28800
diff changeset
1441 call assert_equal(2, winnr('$'))
b93668df9160 patch 8.2.4943: changing 'switchbuf' may have no effect
Bram Moolenaar <Bram@vim.org>
parents: 28800
diff changeset
1442 only!
b93668df9160 patch 8.2.4943: changing 'switchbuf' may have no effect
Bram Moolenaar <Bram@vim.org>
parents: 28800
diff changeset
1443 endfunc
b93668df9160 patch 8.2.4943: changing 'switchbuf' may have no effect
Bram Moolenaar <Bram@vim.org>
parents: 28800
diff changeset
1444
30417
6a1862bfb280 patch 9.0.0544: minor issues with setting a string option
Bram Moolenaar <Bram@vim.org>
parents: 30415
diff changeset
1445 " :set empty string for global 'keywordprg' falls back to ":help"
6a1862bfb280 patch 9.0.0544: minor issues with setting a string option
Bram Moolenaar <Bram@vim.org>
parents: 30415
diff changeset
1446 func Test_keywordprg_empty()
6a1862bfb280 patch 9.0.0544: minor issues with setting a string option
Bram Moolenaar <Bram@vim.org>
parents: 30415
diff changeset
1447 let k = &keywordprg
6a1862bfb280 patch 9.0.0544: minor issues with setting a string option
Bram Moolenaar <Bram@vim.org>
parents: 30415
diff changeset
1448 set keywordprg=man
6a1862bfb280 patch 9.0.0544: minor issues with setting a string option
Bram Moolenaar <Bram@vim.org>
parents: 30415
diff changeset
1449 call assert_equal('man', &keywordprg)
6a1862bfb280 patch 9.0.0544: minor issues with setting a string option
Bram Moolenaar <Bram@vim.org>
parents: 30415
diff changeset
1450 set keywordprg=
6a1862bfb280 patch 9.0.0544: minor issues with setting a string option
Bram Moolenaar <Bram@vim.org>
parents: 30415
diff changeset
1451 call assert_equal(':help', &keywordprg)
6a1862bfb280 patch 9.0.0544: minor issues with setting a string option
Bram Moolenaar <Bram@vim.org>
parents: 30415
diff changeset
1452 set keywordprg=man
6a1862bfb280 patch 9.0.0544: minor issues with setting a string option
Bram Moolenaar <Bram@vim.org>
parents: 30415
diff changeset
1453 call assert_equal('man', &keywordprg)
6a1862bfb280 patch 9.0.0544: minor issues with setting a string option
Bram Moolenaar <Bram@vim.org>
parents: 30415
diff changeset
1454 call assert_equal("\n keywordprg=:help", execute('set kp= kp?'))
6a1862bfb280 patch 9.0.0544: minor issues with setting a string option
Bram Moolenaar <Bram@vim.org>
parents: 30415
diff changeset
1455 let &keywordprg = k
6a1862bfb280 patch 9.0.0544: minor issues with setting a string option
Bram Moolenaar <Bram@vim.org>
parents: 30415
diff changeset
1456 endfunc
6a1862bfb280 patch 9.0.0544: minor issues with setting a string option
Bram Moolenaar <Bram@vim.org>
parents: 30415
diff changeset
1457
31055
5a95f0c630b1 patch 9.0.0862: default value of 'endoffile' is wrong
Bram Moolenaar <Bram@vim.org>
parents: 30986
diff changeset
1458 " check that the very first buffer created does not have 'endoffile' set
5a95f0c630b1 patch 9.0.0862: default value of 'endoffile' is wrong
Bram Moolenaar <Bram@vim.org>
parents: 30986
diff changeset
1459 func Test_endoffile_default()
5a95f0c630b1 patch 9.0.0862: default value of 'endoffile' is wrong
Bram Moolenaar <Bram@vim.org>
parents: 30986
diff changeset
1460 let after =<< trim [CODE]
5a95f0c630b1 patch 9.0.0862: default value of 'endoffile' is wrong
Bram Moolenaar <Bram@vim.org>
parents: 30986
diff changeset
1461 call writefile([execute('set eof?')], 'Xtestout')
5a95f0c630b1 patch 9.0.0862: default value of 'endoffile' is wrong
Bram Moolenaar <Bram@vim.org>
parents: 30986
diff changeset
1462 qall!
5a95f0c630b1 patch 9.0.0862: default value of 'endoffile' is wrong
Bram Moolenaar <Bram@vim.org>
parents: 30986
diff changeset
1463 [CODE]
5a95f0c630b1 patch 9.0.0862: default value of 'endoffile' is wrong
Bram Moolenaar <Bram@vim.org>
parents: 30986
diff changeset
1464 if RunVim([], after, '')
5a95f0c630b1 patch 9.0.0862: default value of 'endoffile' is wrong
Bram Moolenaar <Bram@vim.org>
parents: 30986
diff changeset
1465 call assert_equal(["\nnoendoffile"], readfile('Xtestout'))
5a95f0c630b1 patch 9.0.0862: default value of 'endoffile' is wrong
Bram Moolenaar <Bram@vim.org>
parents: 30986
diff changeset
1466 endif
5a95f0c630b1 patch 9.0.0862: default value of 'endoffile' is wrong
Bram Moolenaar <Bram@vim.org>
parents: 30986
diff changeset
1467 call delete('Xtestout')
5a95f0c630b1 patch 9.0.0862: default value of 'endoffile' is wrong
Bram Moolenaar <Bram@vim.org>
parents: 30986
diff changeset
1468 endfunc
5a95f0c630b1 patch 9.0.0862: default value of 'endoffile' is wrong
Bram Moolenaar <Bram@vim.org>
parents: 30986
diff changeset
1469
31950
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1470 " Test for setting the 'lines' and 'columns' options to a minimum value
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1471 func Test_set_min_lines_columns()
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1472 let save_lines = &lines
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1473 let save_columns = &columns
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1474
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1475 let after =<< trim END
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1476 set nomore
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1477 let msg = []
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1478 let v:errmsg = ''
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1479 silent! let &columns=0
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1480 call add(msg, v:errmsg)
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1481 silent! set columns=0
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1482 call add(msg, v:errmsg)
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1483 silent! call setbufvar('', '&columns', 0)
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1484 call add(msg, v:errmsg)
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1485 "call writefile(msg, 'XResultsetminlines')
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1486 silent! let &lines=0
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1487 call add(msg, v:errmsg)
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1488 silent! set lines=0
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1489 call add(msg, v:errmsg)
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1490 silent! call setbufvar('', '&lines', 0)
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1491 call add(msg, v:errmsg)
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1492 call writefile(msg, 'XResultsetminlines')
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1493 qall!
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1494 END
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1495 if RunVim([], after, '')
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1496 call assert_equal(['E594: Need at least 12 columns',
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1497 \ 'E594: Need at least 12 columns: columns=0',
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1498 \ 'E594: Need at least 12 columns',
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1499 \ 'E593: Need at least 2 lines',
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1500 \ 'E593: Need at least 2 lines: lines=0',
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1501 \ 'E593: Need at least 2 lines',], readfile('XResultsetminlines'))
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1502 endif
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1503
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1504 call delete('XResultsetminlines')
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1505 let &lines = save_lines
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1506 let &columns = save_columns
b0717fcca5eb patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Bram Moolenaar <Bram@vim.org>
parents: 31055
diff changeset
1507 endfunc
30417
6a1862bfb280 patch 9.0.0544: minor issues with setting a string option
Bram Moolenaar <Bram@vim.org>
parents: 30415
diff changeset
1508
19231
b8fd7364befd patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 19137
diff changeset
1509 " vim: shiftwidth=2 sts=2 expandtab