annotate src/testdir/test_options.vim @ 16722:19ca17f9e155 v8.1.1363

patch 8.1.1363: ":vert options" does not make a vertical split commit https://github.com/vim/vim/commit/e0b5949a3b28be9940bb8a46b2579e960100b83b Author: Bram Moolenaar <Bram@vim.org> Date: Tue May 21 20:54:45 2019 +0200 patch 8.1.1363: ":vert options" does not make a vertical split Problem: ":vert options" does not make a vertical split. Solution: Pass the right modifiers in $OPTWIN_CMD. (Ken Takata, closes #4401)
author Bram Moolenaar <Bram@vim.org>
date Tue, 21 May 2019 21:00:07 +0200
parents ca1814eeecf5
children d726d8cce996
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
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14869
diff changeset
3 func Test_whichwrap()
9798
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 set whichwrap=b,s
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 call assert_equal('b,s', &whichwrap)
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 set whichwrap+=h,l
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 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
9
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 set whichwrap+=h,l
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 call assert_equal('b,s,h,l', &whichwrap)
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 set whichwrap+=h,l
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 call assert_equal('b,s,h,l', &whichwrap)
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15
10831
e926c5a7f9bf patch 8.0.0305: invalid memory access when option has duplicate flag
Christian Brabandt <cb@256bit.org>
parents: 10823
diff changeset
16 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
17 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
18
e926c5a7f9bf patch 8.0.0305: invalid memory access when option has duplicate flag
Christian Brabandt <cb@256bit.org>
parents: 10823
diff changeset
19 set whichwrap=h,h,h
e926c5a7f9bf patch 8.0.0305: invalid memory access when option has duplicate flag
Christian Brabandt <cb@256bit.org>
parents: 10823
diff changeset
20 call assert_equal('h', &whichwrap)
e926c5a7f9bf patch 8.0.0305: invalid memory access when option has duplicate flag
Christian Brabandt <cb@256bit.org>
parents: 10823
diff changeset
21
9798
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 set whichwrap&
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14869
diff changeset
23 endfunc
9798
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14869
diff changeset
25 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
26 " 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
27 set isfname=
141fe140976c patch 8.0.0355: using uninitialized memory when 'isfname' is empty
Christian Brabandt <cb@256bit.org>
parents: 10906
diff changeset
28 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
29 set isfname&
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14869
diff changeset
30 endfunc
10932
141fe140976c patch 8.0.0355: using uninitialized memory when 'isfname' is empty
Christian Brabandt <cb@256bit.org>
parents: 10906
diff changeset
31
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14869
diff changeset
32 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
33 " 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
34 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
35 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
36 set wildchar=<Esc>
6da4287fd735 patch 8.0.0370: invalid memory access when setting wildchar empty
Christian Brabandt <cb@256bit.org>
parents: 10958
diff changeset
37 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
38 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
39 set wildchar=27
6da4287fd735 patch 8.0.0370: invalid memory access when setting wildchar empty
Christian Brabandt <cb@256bit.org>
parents: 10958
diff changeset
40 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
41 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
42 set wildchar&
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14869
diff changeset
43 endfunc
10962
6da4287fd735 patch 8.0.0370: invalid memory access when setting wildchar empty
Christian Brabandt <cb@256bit.org>
parents: 10958
diff changeset
44
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14869
diff changeset
45 func Test_options()
9798
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 let caught = 'ok'
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 try
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 options
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 catch
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 let caught = v:throwpoint . "\n" . v:exception
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 endtry
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 call assert_equal('ok', caught)
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53
16722
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
54 " 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
55 wincmd j
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
56 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
57 wincmd k
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
58 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
59 " 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
60 close
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
61
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
62 " 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
63 vert options
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
64 " 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
65 wincmd l
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
66 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
67 wincmd h
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
68 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
69 " 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
70 close
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
71
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
72 " 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
73 tab options
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
74 " 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
75 normal gT
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
76 call assert_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
77 normal gt
19ca17f9e155 patch 8.1.1363: ":vert options" does not make a vertical split
Bram Moolenaar <Bram@vim.org>
parents: 16664
diff changeset
78 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
79
9798
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
80 " close option-window
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
81 close
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14869
diff changeset
82 endfunc
9798
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
83
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14869
diff changeset
84 func Test_path_keep_commas()
9798
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
85 " Test that changing 'path' keeps two commas.
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
86 set path=foo,,bar
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
87 set path-=bar
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
88 set path+=bar
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
89 call assert_equal('foo,,bar', &path)
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
90
e34e4547f3d1 commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
91 set path&
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14869
diff changeset
92 endfunc
9852
4eea48b76d03 commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents: 9798
diff changeset
93
4eea48b76d03 commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents: 9798
diff changeset
94 func Test_signcolumn()
9856
12c5c2614432 commit https://github.com/vim/vim/commit/ebcccad573a7722e16cf2dd435cc62b61f61d9cc
Christian Brabandt <cb@256bit.org>
parents: 9852
diff changeset
95 if has('signs')
12c5c2614432 commit https://github.com/vim/vim/commit/ebcccad573a7722e16cf2dd435cc62b61f61d9cc
Christian Brabandt <cb@256bit.org>
parents: 9852
diff changeset
96 call assert_equal("auto", &signcolumn)
12c5c2614432 commit https://github.com/vim/vim/commit/ebcccad573a7722e16cf2dd435cc62b61f61d9cc
Christian Brabandt <cb@256bit.org>
parents: 9852
diff changeset
97 set signcolumn=yes
12c5c2614432 commit https://github.com/vim/vim/commit/ebcccad573a7722e16cf2dd435cc62b61f61d9cc
Christian Brabandt <cb@256bit.org>
parents: 9852
diff changeset
98 set signcolumn=no
12c5c2614432 commit https://github.com/vim/vim/commit/ebcccad573a7722e16cf2dd435cc62b61f61d9cc
Christian Brabandt <cb@256bit.org>
parents: 9852
diff changeset
99 call assert_fails('set signcolumn=nope')
12c5c2614432 commit https://github.com/vim/vim/commit/ebcccad573a7722e16cf2dd435cc62b61f61d9cc
Christian Brabandt <cb@256bit.org>
parents: 9852
diff changeset
100 endif
9852
4eea48b76d03 commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents: 9798
diff changeset
101 endfunc
4eea48b76d03 commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents: 9798
diff changeset
102
10322
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
103 func Test_filetype_valid()
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
104 set ft=valid_name
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
105 call assert_equal("valid_name", &filetype)
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
106 set ft=valid-name
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
107 call assert_equal("valid-name", &filetype)
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
108
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
109 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
110 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
111 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
112 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
113 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
114 call assert_equal("valid-name", &filetype)
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
115
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
116 exe "set ft=trunc\x00name"
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
117 call assert_equal("trunc", &filetype)
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
118 endfunc
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
119
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
120 func Test_syntax_valid()
10324
ecbd3412f214 commit https://github.com/vim/vim/commit/9376f5f482a4d579436bf364778c2d8ab8e2f22d
Christian Brabandt <cb@256bit.org>
parents: 10322
diff changeset
121 if !has('syntax')
ecbd3412f214 commit https://github.com/vim/vim/commit/9376f5f482a4d579436bf364778c2d8ab8e2f22d
Christian Brabandt <cb@256bit.org>
parents: 10322
diff changeset
122 return
ecbd3412f214 commit https://github.com/vim/vim/commit/9376f5f482a4d579436bf364778c2d8ab8e2f22d
Christian Brabandt <cb@256bit.org>
parents: 10322
diff changeset
123 endif
10322
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
124 set syn=valid_name
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
125 call assert_equal("valid_name", &syntax)
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
126 set syn=valid-name
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
127 call assert_equal("valid-name", &syntax)
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
128
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
129 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
130 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
131 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
132 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
133 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
134 call assert_equal("valid-name", &syntax)
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
135
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
136 exe "set syn=trunc\x00name"
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
137 call assert_equal("trunc", &syntax)
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
138 endfunc
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
139
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
140 func Test_keymap_valid()
10324
ecbd3412f214 commit https://github.com/vim/vim/commit/9376f5f482a4d579436bf364778c2d8ab8e2f22d
Christian Brabandt <cb@256bit.org>
parents: 10322
diff changeset
141 if !has('keymap')
ecbd3412f214 commit https://github.com/vim/vim/commit/9376f5f482a4d579436bf364778c2d8ab8e2f22d
Christian Brabandt <cb@256bit.org>
parents: 10322
diff changeset
142 return
ecbd3412f214 commit https://github.com/vim/vim/commit/9376f5f482a4d579436bf364778c2d8ab8e2f22d
Christian Brabandt <cb@256bit.org>
parents: 10322
diff changeset
143 endif
10322
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
144 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
145 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
146 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
147 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
148
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
149 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
150 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
151 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
152 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
153 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
154
5adc318767be commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents: 9856
diff changeset
155 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
156 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
157 endfunc
10416
ef5474130b0e commit https://github.com/vim/vim/commit/7554da4033498c4da0af3cde542c3e87e9097b73
Christian Brabandt <cb@256bit.org>
parents: 10324
diff changeset
158
10420
7a631c6b0a20 commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents: 10416
diff changeset
159 func Check_dir_option(name)
10416
ef5474130b0e commit https://github.com/vim/vim/commit/7554da4033498c4da0af3cde542c3e87e9097b73
Christian Brabandt <cb@256bit.org>
parents: 10324
diff changeset
160 " 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
161 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
162 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
163 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
164 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
165 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
166 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
167
ef5474130b0e commit https://github.com/vim/vim/commit/7554da4033498c4da0af3cde542c3e87e9097b73
Christian Brabandt <cb@256bit.org>
parents: 10324
diff changeset
168 " Check rejecting weird characters.
10420
7a631c6b0a20 commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents: 10416
diff changeset
169 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
170 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
171 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
172 endfunc
10420
7a631c6b0a20 commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents: 10416
diff changeset
173
10938
3b82ab325d59 patch 8.0.0358: invalid memory access in C-indent code
Christian Brabandt <cb@256bit.org>
parents: 10936
diff changeset
174 func Test_cinkeys()
3b82ab325d59 patch 8.0.0358: invalid memory access in C-indent code
Christian Brabandt <cb@256bit.org>
parents: 10936
diff changeset
175 " 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
176 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
177 norm a
3b82ab325d59 patch 8.0.0358: invalid memory access in C-indent code
Christian Brabandt <cb@256bit.org>
parents: 10936
diff changeset
178 set cindent& cinkeys&
3b82ab325d59 patch 8.0.0358: invalid memory access in C-indent code
Christian Brabandt <cb@256bit.org>
parents: 10936
diff changeset
179 endfunc
3b82ab325d59 patch 8.0.0358: invalid memory access in C-indent code
Christian Brabandt <cb@256bit.org>
parents: 10936
diff changeset
180
10420
7a631c6b0a20 commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents: 10416
diff changeset
181 func Test_dictionary()
7a631c6b0a20 commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents: 10416
diff changeset
182 call Check_dir_option('dictionary')
7a631c6b0a20 commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents: 10416
diff changeset
183 endfunc
7a631c6b0a20 commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents: 10416
diff changeset
184
7a631c6b0a20 commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents: 10416
diff changeset
185 func Test_thesaurus()
7a631c6b0a20 commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents: 10416
diff changeset
186 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
187 endfun
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
188
10887
40939b171432 patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Christian Brabandt <cb@256bit.org>
parents: 10831
diff changeset
189 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
190 " 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
191 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
192 new
40939b171432 patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Christian Brabandt <cb@256bit.org>
parents: 10831
diff changeset
193 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
194 bwipe!
40939b171432 patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Christian Brabandt <cb@256bit.org>
parents: 10831
diff changeset
195 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
196 endfun
40939b171432 patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Christian Brabandt <cb@256bit.org>
parents: 10831
diff changeset
197
10823
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
198 func Test_set_completion()
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
199 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
200 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
201
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
202 " Expand boolan options. When doing :set no<Tab>
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
203 " 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
204 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
205 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
206
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
207 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
208 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
209
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
210 " Expand abbreviation of options.
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
211 call feedkeys(":set ts\<C-A>\<C-B>\"\<CR>", 'tx')
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
212 call assert_equal('"set tabstop thesaurus ttyscroll', @:)
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
213
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
214 " Expand current value
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
215 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
216 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
217
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
218 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
219 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
220
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
221 " Expand key codes.
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
222 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
223 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
224
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
225 " Expand terminal options.
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
226 call feedkeys(":set t_A\<C-A>\<C-B>\"\<CR>", 'tx')
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
227 call assert_equal('"set t_AB t_AF t_AL', @:)
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
228
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
229 " Expand directories.
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
230 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
231 call assert_match(' ./samples/ ', @:)
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
232 call assert_notmatch(' ./small.vim ', @:)
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
233
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
234 " Expand files and directories.
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
235 call feedkeys(":set tags=./\<C-A>\<C-B>\"\<CR>", 'tx')
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
236 call assert_match(' ./samples/.* ./small.vim', @:)
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
237
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
238 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
239 call assert_equal('"set tags=./\\ diff diffexpr diffopt', @:)
10420
7a631c6b0a20 commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents: 10416
diff changeset
240 endfunc
10823
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
241
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
242 func Test_set_errors()
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
243 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
244 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
245 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
246 call assert_fails('set history=10001', 'E474:')
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
247 call assert_fails('set numberwidth=11', 'E474:')
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
248 call assert_fails('set colorcolumn=-a')
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
249 call assert_fails('set colorcolumn=a')
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
250 call assert_fails('set colorcolumn=1,')
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
251 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
252 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
253 if has('conceal')
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
254 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
255 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
256 endif
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
257 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
258 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
259 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
260 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
261 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
262 call assert_fails('set tabstop=-1', 'E487:')
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
263 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
264 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
265 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
266 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
267 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
268 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
269 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
270 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
271 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
272 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
273 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
274 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
275 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
276 call assert_fails('set commentstring=x', 'E537:')
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
277 call assert_fails('set complete=x', 'E539:')
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
278 call assert_fails('set statusline=%{', 'E540:')
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
279 call assert_fails('set statusline=' . repeat("%p", 81), 'E541:')
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
280 call assert_fails('set statusline=%(', 'E542:')
10936
a516b6c279d9 patch 8.0.0357: crash when setting 'guicursor' to weird value
Christian Brabandt <cb@256bit.org>
parents: 10932
diff changeset
281 if has('cursorshape')
a516b6c279d9 patch 8.0.0357: crash when setting 'guicursor' to weird value
Christian Brabandt <cb@256bit.org>
parents: 10932
diff changeset
282 " 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
283 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
284 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
285 call assert_fails('set guicursor=x', 'E545:')
a516b6c279d9 patch 8.0.0357: crash when setting 'guicursor' to weird value
Christian Brabandt <cb@256bit.org>
parents: 10932
diff changeset
286 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
287 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
288 endif
10823
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
289 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
290 call assert_fails('set winminheight=10 winheight=9', 'E591:')
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
291 call assert_fails('set winminwidth=10 winwidth=9', 'E592:')
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
292 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
293 call assert_fails('set t_foo=', 'E846:')
a7da553980ee patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents: 10420
diff changeset
294 endfunc
10906
7fc1df5536c9 patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents: 10887
diff changeset
295
14867
cf4d6489c9eb patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents: 14617
diff changeset
296 " 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
297 func Test_000_term_option_verbose()
14869
7f669f95356e patch 8.1.0446: options test fails in the GUI
Christian Brabandt <cb@256bit.org>
parents: 14867
diff changeset
298 if has('gui_running')
7f669f95356e patch 8.1.0446: options test fails in the GUI
Christian Brabandt <cb@256bit.org>
parents: 14867
diff changeset
299 return
7f669f95356e patch 8.1.0446: options test fails in the GUI
Christian Brabandt <cb@256bit.org>
parents: 14867
diff changeset
300 endif
14867
cf4d6489c9eb patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents: 14617
diff changeset
301 let verb_cm = execute('verbose set t_cm')
cf4d6489c9eb patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents: 14617
diff changeset
302 call assert_notmatch('Last set from', verb_cm)
cf4d6489c9eb patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents: 14617
diff changeset
303
cf4d6489c9eb patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents: 14617
diff changeset
304 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
305 set term=ansi
cf4d6489c9eb patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents: 14617
diff changeset
306 let verb_cm = execute('verbose set t_cm')
cf4d6489c9eb patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents: 14617
diff changeset
307 call assert_match('Last set from.*test_options.vim', verb_cm)
cf4d6489c9eb patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents: 14617
diff changeset
308 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
309 endfunc
cf4d6489c9eb patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents: 14617
diff changeset
310
10906
7fc1df5536c9 patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents: 10887
diff changeset
311 func Test_set_ttytype()
7fc1df5536c9 patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents: 10887
diff changeset
312 if !has('gui_running') && has('unix')
7fc1df5536c9 patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents: 10887
diff changeset
313 " Setting 'ttytype' used to cause a double-free when exiting vim and
7fc1df5536c9 patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents: 10887
diff changeset
314 " when vim is compiled with -DEXITFREE.
7fc1df5536c9 patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents: 10887
diff changeset
315 set ttytype=ansi
7fc1df5536c9 patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents: 10887
diff changeset
316 call assert_equal('ansi', &ttytype)
7fc1df5536c9 patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents: 10887
diff changeset
317 call assert_equal(&ttytype, &term)
7fc1df5536c9 patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents: 10887
diff changeset
318 set ttytype=xterm
7fc1df5536c9 patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents: 10887
diff changeset
319 call assert_equal('xterm', &ttytype)
7fc1df5536c9 patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents: 10887
diff changeset
320 call assert_equal(&ttytype, &term)
11348
4e5191165707 patch 8.0.0559: setting ttytype to xxx does not always fail
Christian Brabandt <cb@256bit.org>
parents: 11081
diff changeset
321 " "set ttytype=" gives E522 instead of E529
4e5191165707 patch 8.0.0559: setting ttytype to xxx does not always fail
Christian Brabandt <cb@256bit.org>
parents: 11081
diff changeset
322 " in travis on some builds. Why? Catch both for now
4e5191165707 patch 8.0.0559: setting ttytype to xxx does not always fail
Christian Brabandt <cb@256bit.org>
parents: 11081
diff changeset
323 try
4e5191165707 patch 8.0.0559: setting ttytype to xxx does not always fail
Christian Brabandt <cb@256bit.org>
parents: 11081
diff changeset
324 set ttytype=
13872
9d3ddfa88a56 patch 8.0.1807: function to set terminal name is too long
Christian Brabandt <cb@256bit.org>
parents: 13664
diff changeset
325 call assert_report('set ttytype= did not fail')
11348
4e5191165707 patch 8.0.0559: setting ttytype to xxx does not always fail
Christian Brabandt <cb@256bit.org>
parents: 11081
diff changeset
326 catch /E529\|E522/
4e5191165707 patch 8.0.0559: setting ttytype to xxx does not always fail
Christian Brabandt <cb@256bit.org>
parents: 11081
diff changeset
327 endtry
4e5191165707 patch 8.0.0559: setting ttytype to xxx does not always fail
Christian Brabandt <cb@256bit.org>
parents: 11081
diff changeset
328
4e5191165707 patch 8.0.0559: setting ttytype to xxx does not always fail
Christian Brabandt <cb@256bit.org>
parents: 11081
diff changeset
329 " Some systems accept any terminal name and return dumb settings,
4e5191165707 patch 8.0.0559: setting ttytype to xxx does not always fail
Christian Brabandt <cb@256bit.org>
parents: 11081
diff changeset
330 " check for failure of finding the entry and for missing 'cm' entry.
4e5191165707 patch 8.0.0559: setting ttytype to xxx does not always fail
Christian Brabandt <cb@256bit.org>
parents: 11081
diff changeset
331 try
4e5191165707 patch 8.0.0559: setting ttytype to xxx does not always fail
Christian Brabandt <cb@256bit.org>
parents: 11081
diff changeset
332 set ttytype=xxx
13872
9d3ddfa88a56 patch 8.0.1807: function to set terminal name is too long
Christian Brabandt <cb@256bit.org>
parents: 13664
diff changeset
333 call assert_report('set ttytype=xxx did not fail')
11348
4e5191165707 patch 8.0.0559: setting ttytype to xxx does not always fail
Christian Brabandt <cb@256bit.org>
parents: 11081
diff changeset
334 catch /E522\|E437/
4e5191165707 patch 8.0.0559: setting ttytype to xxx does not always fail
Christian Brabandt <cb@256bit.org>
parents: 11081
diff changeset
335 endtry
4e5191165707 patch 8.0.0559: setting ttytype to xxx does not always fail
Christian Brabandt <cb@256bit.org>
parents: 11081
diff changeset
336
10906
7fc1df5536c9 patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents: 10887
diff changeset
337 set ttytype&
7fc1df5536c9 patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents: 10887
diff changeset
338 call assert_equal(&ttytype, &term)
7fc1df5536c9 patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents: 10887
diff changeset
339 endif
7fc1df5536c9 patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents: 10887
diff changeset
340 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
341
e5896de85dcf patch 8.0.0368: not all options are tested with a range of values
Christian Brabandt <cb@256bit.org>
parents: 10938
diff changeset
342 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
343 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
344 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
345 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
346 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
347 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
348 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
349 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
350 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
351 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
352
e5896de85dcf patch 8.0.0368: not all options are tested with a range of values
Christian Brabandt <cb@256bit.org>
parents: 10938
diff changeset
353 func Test_set_values()
e5896de85dcf patch 8.0.0368: not all options are tested with a range of values
Christian Brabandt <cb@256bit.org>
parents: 10938
diff changeset
354 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
355 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
356 else
bbdb4f0134cb patch 8.0.0429: options test does not always test everything
Christian Brabandt <cb@256bit.org>
parents: 10962
diff changeset
357 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
358 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
359 endfunc
11380
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
360
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
361 func ResetIndentexpr()
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
362 set indentexpr=
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
363 endfunc
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
364
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
365 func Test_set_indentexpr()
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
366 " 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
367 set indentexpr=ResetIndentexpr()
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
368 new
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
369 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
370 call assert_equal('', &indentexpr)
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
371 bwipe!
2334a8ae9ff6 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Christian Brabandt <cb@256bit.org>
parents: 11348
diff changeset
372 endfunc
13664
f64c5e636c9f patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents: 11380
diff changeset
373
f64c5e636c9f patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents: 11380
diff changeset
374 func Test_backupskip()
15685
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
375 " 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
376 " 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
377 " 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
378 " list.
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
379 let bsklist = split(&bsk, ',')
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
380
13664
f64c5e636c9f patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents: 11380
diff changeset
381 if has("mac")
15685
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
382 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
383 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
384 elseif has("unix")
15685
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
385 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
386 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
387 endif
f64c5e636c9f patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents: 11380
diff changeset
388
15685
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
389 " 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
390 " 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
391 " (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
392 " 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
393 " 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
394 " 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
395 "
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
396 " 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
397 " 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
398 " 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
399 " append it afterwards.
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
400 if has('win32')
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
401 let item_nbr = 0
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
402 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
403 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
404 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
405 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
406 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
407 let item_nbr += 1
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
408 endwhile
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
409 endif
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
410
e472308af17d patch 8.1.0850: test for 'backupskip' is not correct
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
411 " 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
412 " 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
413 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
414 if exists(var)
f64c5e636c9f patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents: 11380
diff changeset
415 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
416 let varvalue = substitute(varvalue, '/$', '', '')
a8ed064ed316 patch 8.1.0853: options test fails on Mac
Bram Moolenaar <Bram@vim.org>
parents: 15685
diff changeset
417 let varvalue .= '/*'
a8ed064ed316 patch 8.1.0853: options test fails on Mac
Bram Moolenaar <Bram@vim.org>
parents: 15685
diff changeset
418 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
419 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
420 endif
f64c5e636c9f patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents: 11380
diff changeset
421 endfor
f64c5e636c9f patch 8.0.1704: 'backupskip' default doesn't work for Mac
Christian Brabandt <cb@256bit.org>
parents: 11380
diff changeset
422 endfunc
13931
fc03fabbedc5 patch 8.0.1836: buffer-local window options may not be recent
Christian Brabandt <cb@256bit.org>
parents: 13872
diff changeset
423
fc03fabbedc5 patch 8.0.1836: buffer-local window options may not be recent
Christian Brabandt <cb@256bit.org>
parents: 13872
diff changeset
424 func Test_copy_winopt()
14617
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
425 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
426
14617
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
427 " 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
428 split
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
429 enew
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
430 setlocal numberwidth=5
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
431 wincmd w
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
432 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
433 bnext
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
434 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
435 bw!
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
436 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
437
14617
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
438 " 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
439 split
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
440 enew
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
441 setlocal numberwidth=6
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
442 bnext
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
443 wincmd w
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
444 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
445 bnext
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
446 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
447 bw!
13931
fc03fabbedc5 patch 8.0.1836: buffer-local window options may not be recent
Christian Brabandt <cb@256bit.org>
parents: 13872
diff changeset
448
14617
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
449 " 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
450 " 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
451 split
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
452 enew
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
453 setlocal numberwidth=7
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
454 bnext
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
455 bnext
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
456 setlocal numberwidth=8
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
457 wincmd w
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
458 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
459 bnext
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
460 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
461 bw!
13931
fc03fabbedc5 patch 8.0.1836: buffer-local window options may not be recent
Christian Brabandt <cb@256bit.org>
parents: 13872
diff changeset
462
14617
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
463 " 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
464 enew
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
465 split
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
466 setlocal numberwidth=9
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
467 bnext
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
468 setlocal numberwidth=10
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
469 wincmd w
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
470 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
471 bnext
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
472 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
473 bw!
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
474
56ceaa0ad239 patch 8.1.0322: Test_copy_winopt() does not restore 'hidden'
Christian Brabandt <cb@256bit.org>
parents: 14593
diff changeset
475 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
476 endfunc
14185
20468fb49f9b patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents: 13931
diff changeset
477
20468fb49f9b patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents: 13931
diff changeset
478 func Test_shortmess_F()
20468fb49f9b patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents: 13931
diff changeset
479 new
20468fb49f9b patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents: 13931
diff changeset
480 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
481 set shortmess+=F
20468fb49f9b patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents: 13931
diff changeset
482 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
483 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
484 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
485 set shortmess-=F
20468fb49f9b patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents: 13931
diff changeset
486 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
487 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
488 set shortmess&
20468fb49f9b patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents: 13931
diff changeset
489 bwipe
20468fb49f9b patch 8.1.0110: file name not displayed with ":file"
Christian Brabandt <cb@256bit.org>
parents: 13931
diff changeset
490 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
491
b6b2f7d69c7f patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Christian Brabandt <cb@256bit.org>
parents: 14517
diff changeset
492 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
493 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
494 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
495 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
496 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
497 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
498 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
499 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
500 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
501 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
502 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
503 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
504 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
505 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
506 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
507 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
508 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
509 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
510 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
511 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
512 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
513 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
514 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
515 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
516 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
517 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
518
ad8b2c109b22 patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents: 15691
diff changeset
519 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
520 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
521 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
522 split
ad8b2c109b22 patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents: 15691
diff changeset
523 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
524 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
525 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
526 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
527 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
528 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
529 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
530 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
531 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
532 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
533 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
534 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
535
ad8b2c109b22 patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents: 15691
diff changeset
536 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
537 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
538 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
539 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
540 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
541 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
542 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
543 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
544 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
545 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
546 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
547 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
548
ad8b2c109b22 patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents: 15691
diff changeset
549 close
ad8b2c109b22 patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents: 15691
diff changeset
550 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
551 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
552 endfunc
16202
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
553
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
554 func Test_writedelay()
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
555 if !has('reltime')
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
556 return
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
557 endif
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
558 new
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
559 call setline(1, 'empty')
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
560 redraw
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
561 set writedelay=10
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
562 let start = reltime()
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
563 call setline(1, repeat('x', 70))
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
564 redraw
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
565 let elapsed = reltimefloat(reltime(start))
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
566 set writedelay=0
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
567 " 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
568 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
569
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
570 bwipe!
676069de7214 patch 8.1.1106: no test for 'writedelay'
Bram Moolenaar <Bram@vim.org>
parents: 15713
diff changeset
571 endfunc
16204
e49b0957a0c7 patch 8.1.1107: no test for 'visualbell'
Bram Moolenaar <Bram@vim.org>
parents: 16202
diff changeset
572
e49b0957a0c7 patch 8.1.1107: no test for 'visualbell'
Bram Moolenaar <Bram@vim.org>
parents: 16202
diff changeset
573 func Test_visualbell()
16206
d302c496e98b patch 8.1.1108: test for 'visualbell' doesn't work
Bram Moolenaar <Bram@vim.org>
parents: 16204
diff changeset
574 set belloff=
16204
e49b0957a0c7 patch 8.1.1107: no test for 'visualbell'
Bram Moolenaar <Bram@vim.org>
parents: 16202
diff changeset
575 set visualbell
e49b0957a0c7 patch 8.1.1107: no test for 'visualbell'
Bram Moolenaar <Bram@vim.org>
parents: 16202
diff changeset
576 call assert_beeps('normal 0h')
e49b0957a0c7 patch 8.1.1107: no test for 'visualbell'
Bram Moolenaar <Bram@vim.org>
parents: 16202
diff changeset
577 set novisualbell
16206
d302c496e98b patch 8.1.1108: test for 'visualbell' doesn't work
Bram Moolenaar <Bram@vim.org>
parents: 16204
diff changeset
578 set belloff=all
16204
e49b0957a0c7 patch 8.1.1107: no test for 'visualbell'
Bram Moolenaar <Bram@vim.org>
parents: 16202
diff changeset
579 endfunc