Mercurial > vim
annotate src/testdir/test_options.vim @ 10932:141fe140976c v8.0.0355
patch 8.0.0355: using uninitialized memory when 'isfname' is empty
commit https://github.com/vim/vim/commit/187a4f28140f10ff833862be7e3ef823d317e1c7
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Feb 23 17:07:14 2017 +0100
patch 8.0.0355: using uninitialized memory when 'isfname' is empty
Problem: Using uninitialized memory when 'isfname' is empty.
Solution: Don't call getpwnam() without an argument. (Dominique Pelle,
closes #1464)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 23 Feb 2017 17:15:04 +0100 |
parents | 7fc1df5536c9 |
children | a516b6c279d9 |
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 |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 function! Test_whichwrap() |
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& |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 endfunction |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 |
10932
141fe140976c
patch 8.0.0355: using uninitialized memory when 'isfname' is empty
Christian Brabandt <cb@256bit.org>
parents:
10906
diff
changeset
|
25 function! Test_isfname() |
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& |
141fe140976c
patch 8.0.0355: using uninitialized memory when 'isfname' is empty
Christian Brabandt <cb@256bit.org>
parents:
10906
diff
changeset
|
30 endfunction |
141fe140976c
patch 8.0.0355: using uninitialized memory when 'isfname' is empty
Christian Brabandt <cb@256bit.org>
parents:
10906
diff
changeset
|
31 |
9852
4eea48b76d03
commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents:
9798
diff
changeset
|
32 function Test_options() |
9798
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 let caught = 'ok' |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 try |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 options |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 catch |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 let caught = v:throwpoint . "\n" . v:exception |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 endtry |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 call assert_equal('ok', caught) |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 " close option-window |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 close |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 endfunction |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
44 |
9852
4eea48b76d03
commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents:
9798
diff
changeset
|
45 function Test_path_keep_commas() |
9798
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 " Test that changing 'path' keeps two commas. |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
47 set path=foo,,bar |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
48 set path-=bar |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
49 set path+=bar |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
50 call assert_equal('foo,,bar', &path) |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
51 |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
52 set path& |
e34e4547f3d1
commit https://github.com/vim/vim/commit/c8ce615299b4d8c1b2e6cf83496f48cd497d8a37
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
53 endfunction |
9852
4eea48b76d03
commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents:
9798
diff
changeset
|
54 |
4eea48b76d03
commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents:
9798
diff
changeset
|
55 func Test_signcolumn() |
9856
12c5c2614432
commit https://github.com/vim/vim/commit/ebcccad573a7722e16cf2dd435cc62b61f61d9cc
Christian Brabandt <cb@256bit.org>
parents:
9852
diff
changeset
|
56 if has('signs') |
12c5c2614432
commit https://github.com/vim/vim/commit/ebcccad573a7722e16cf2dd435cc62b61f61d9cc
Christian Brabandt <cb@256bit.org>
parents:
9852
diff
changeset
|
57 call assert_equal("auto", &signcolumn) |
12c5c2614432
commit https://github.com/vim/vim/commit/ebcccad573a7722e16cf2dd435cc62b61f61d9cc
Christian Brabandt <cb@256bit.org>
parents:
9852
diff
changeset
|
58 set signcolumn=yes |
12c5c2614432
commit https://github.com/vim/vim/commit/ebcccad573a7722e16cf2dd435cc62b61f61d9cc
Christian Brabandt <cb@256bit.org>
parents:
9852
diff
changeset
|
59 set signcolumn=no |
12c5c2614432
commit https://github.com/vim/vim/commit/ebcccad573a7722e16cf2dd435cc62b61f61d9cc
Christian Brabandt <cb@256bit.org>
parents:
9852
diff
changeset
|
60 call assert_fails('set signcolumn=nope') |
12c5c2614432
commit https://github.com/vim/vim/commit/ebcccad573a7722e16cf2dd435cc62b61f61d9cc
Christian Brabandt <cb@256bit.org>
parents:
9852
diff
changeset
|
61 endif |
9852
4eea48b76d03
commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents:
9798
diff
changeset
|
62 endfunc |
4eea48b76d03
commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents:
9798
diff
changeset
|
63 |
10322
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
64 func Test_filetype_valid() |
10324
ecbd3412f214
commit https://github.com/vim/vim/commit/9376f5f482a4d579436bf364778c2d8ab8e2f22d
Christian Brabandt <cb@256bit.org>
parents:
10322
diff
changeset
|
65 if !has('autocmd') |
ecbd3412f214
commit https://github.com/vim/vim/commit/9376f5f482a4d579436bf364778c2d8ab8e2f22d
Christian Brabandt <cb@256bit.org>
parents:
10322
diff
changeset
|
66 return |
ecbd3412f214
commit https://github.com/vim/vim/commit/9376f5f482a4d579436bf364778c2d8ab8e2f22d
Christian Brabandt <cb@256bit.org>
parents:
10322
diff
changeset
|
67 endif |
10322
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
68 set ft=valid_name |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
69 call assert_equal("valid_name", &filetype) |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
70 set ft=valid-name |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
71 call assert_equal("valid-name", &filetype) |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
72 |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
73 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
|
74 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
|
75 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
|
76 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
|
77 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
|
78 call assert_equal("valid-name", &filetype) |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
79 |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
80 exe "set ft=trunc\x00name" |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
81 call assert_equal("trunc", &filetype) |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
82 endfunc |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
83 |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
84 func Test_syntax_valid() |
10324
ecbd3412f214
commit https://github.com/vim/vim/commit/9376f5f482a4d579436bf364778c2d8ab8e2f22d
Christian Brabandt <cb@256bit.org>
parents:
10322
diff
changeset
|
85 if !has('syntax') |
ecbd3412f214
commit https://github.com/vim/vim/commit/9376f5f482a4d579436bf364778c2d8ab8e2f22d
Christian Brabandt <cb@256bit.org>
parents:
10322
diff
changeset
|
86 return |
ecbd3412f214
commit https://github.com/vim/vim/commit/9376f5f482a4d579436bf364778c2d8ab8e2f22d
Christian Brabandt <cb@256bit.org>
parents:
10322
diff
changeset
|
87 endif |
10322
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
88 set syn=valid_name |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
89 call assert_equal("valid_name", &syntax) |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
90 set syn=valid-name |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
91 call assert_equal("valid-name", &syntax) |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
92 |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
93 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
|
94 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
|
95 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
|
96 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
|
97 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
|
98 call assert_equal("valid-name", &syntax) |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
99 |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
100 exe "set syn=trunc\x00name" |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
101 call assert_equal("trunc", &syntax) |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
102 endfunc |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
103 |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
104 func Test_keymap_valid() |
10324
ecbd3412f214
commit https://github.com/vim/vim/commit/9376f5f482a4d579436bf364778c2d8ab8e2f22d
Christian Brabandt <cb@256bit.org>
parents:
10322
diff
changeset
|
105 if !has('keymap') |
ecbd3412f214
commit https://github.com/vim/vim/commit/9376f5f482a4d579436bf364778c2d8ab8e2f22d
Christian Brabandt <cb@256bit.org>
parents:
10322
diff
changeset
|
106 return |
ecbd3412f214
commit https://github.com/vim/vim/commit/9376f5f482a4d579436bf364778c2d8ab8e2f22d
Christian Brabandt <cb@256bit.org>
parents:
10322
diff
changeset
|
107 endif |
10322
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
108 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
|
109 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
|
110 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
|
111 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
|
112 |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
113 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
|
114 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
|
115 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
|
116 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
|
117 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
|
118 |
5adc318767be
commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a
Christian Brabandt <cb@256bit.org>
parents:
9856
diff
changeset
|
119 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
|
120 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
|
121 endfunc |
10416
ef5474130b0e
commit https://github.com/vim/vim/commit/7554da4033498c4da0af3cde542c3e87e9097b73
Christian Brabandt <cb@256bit.org>
parents:
10324
diff
changeset
|
122 |
10420
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
123 func Check_dir_option(name) |
10416
ef5474130b0e
commit https://github.com/vim/vim/commit/7554da4033498c4da0af3cde542c3e87e9097b73
Christian Brabandt <cb@256bit.org>
parents:
10324
diff
changeset
|
124 " 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
|
125 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
|
126 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
|
127 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
|
128 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
|
129 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
|
130 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
|
131 |
ef5474130b0e
commit https://github.com/vim/vim/commit/7554da4033498c4da0af3cde542c3e87e9097b73
Christian Brabandt <cb@256bit.org>
parents:
10324
diff
changeset
|
132 " Check rejecting weird characters. |
10420
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
133 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
|
134 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
|
135 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
|
136 endfunc |
10420
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
137 |
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
138 func Test_dictionary() |
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
139 call Check_dir_option('dictionary') |
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
140 endfunc |
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
141 |
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
142 func Test_thesaurus() |
7a631c6b0a20
commit https://github.com/vim/vim/commit/f422bcc7f9615fe91fa69b059cfe4785093d3d4a
Christian Brabandt <cb@256bit.org>
parents:
10416
diff
changeset
|
143 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
|
144 endfun |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
145 |
10887
40939b171432
patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Christian Brabandt <cb@256bit.org>
parents:
10831
diff
changeset
|
146 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
|
147 " 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
|
148 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
|
149 new |
40939b171432
patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Christian Brabandt <cb@256bit.org>
parents:
10831
diff
changeset
|
150 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
|
151 bwipe! |
40939b171432
patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Christian Brabandt <cb@256bit.org>
parents:
10831
diff
changeset
|
152 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
|
153 endfun |
40939b171432
patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Christian Brabandt <cb@256bit.org>
parents:
10831
diff
changeset
|
154 |
10823
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
155 func Test_set_completion() |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
156 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
|
157 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
|
158 |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
159 " 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
|
160 " 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
|
161 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
|
162 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
|
163 |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
164 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
|
165 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
|
166 |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
167 " Expand abbreviation of options. |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
168 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
|
169 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
|
170 |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
171 " Expand current value |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
172 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
|
173 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
|
174 |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
175 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
|
176 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
|
177 |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
178 " Expand key codes. |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
179 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
|
180 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
|
181 |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
182 " Expand terminal options. |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
183 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
|
184 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
|
185 |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
186 " Expand directories. |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
187 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
|
188 call assert_match(' ./samples/ ', @:) |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
189 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
|
190 |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
191 " Expand files and directories. |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
192 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
|
193 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
|
194 |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
195 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
|
196 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
|
197 endfunc |
10823
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
198 |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
199 func Test_set_errors() |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
200 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
|
201 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
|
202 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
|
203 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
|
204 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
|
205 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
|
206 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
|
207 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
|
208 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
|
209 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
|
210 if has('conceal') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
211 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
|
212 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
|
213 endif |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
214 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
|
215 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
|
216 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
|
217 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
|
218 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
|
219 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
|
220 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
|
221 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
|
222 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
|
223 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
|
224 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
|
225 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
|
226 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
|
227 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
|
228 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
|
229 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
|
230 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
|
231 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
|
232 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
|
233 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
|
234 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
|
235 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
|
236 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
|
237 call assert_fails('set statusline=%(', 'E542:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
238 call assert_fails('set guicursor=x', 'E545:') |
a7da553980ee
patch 8.0.0301: not enough testing for setting options
Christian Brabandt <cb@256bit.org>
parents:
10420
diff
changeset
|
239 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
|
240 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
|
241 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
|
242 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
|
243 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
|
244 endfunc |
10906
7fc1df5536c9
patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents:
10887
diff
changeset
|
245 |
7fc1df5536c9
patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents:
10887
diff
changeset
|
246 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
|
247 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
|
248 " 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
|
249 " 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
|
250 set ttytype=ansi |
7fc1df5536c9
patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents:
10887
diff
changeset
|
251 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
|
252 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
|
253 set ttytype=xterm |
7fc1df5536c9
patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents:
10887
diff
changeset
|
254 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
|
255 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
|
256 " FIXME: "set ttytype=" gives E522 instead of E529 |
7fc1df5536c9
patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents:
10887
diff
changeset
|
257 " in travis on some builds. Why? Commented out this test for now. |
7fc1df5536c9
patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents:
10887
diff
changeset
|
258 " call assert_fails('set ttytype=', 'E529:') |
7fc1df5536c9
patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents:
10887
diff
changeset
|
259 call assert_fails('set ttytype=xxx', 'E522:') |
7fc1df5536c9
patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents:
10887
diff
changeset
|
260 set ttytype& |
7fc1df5536c9
patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents:
10887
diff
changeset
|
261 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
|
262 endif |
7fc1df5536c9
patch 8.0.0342: double free with EXITFREE and setting 'ttytype'
Christian Brabandt <cb@256bit.org>
parents:
10887
diff
changeset
|
263 endfunc |