comparison src/testdir/test_options.vim @ 15406:63b02fcf1361 v8.1.0711

patch 8.1.0711: test files still use function! commit https://github.com/vim/vim/commit/1e1153600c0377472d62cc553173fe555ddcf5a7 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jan 9 23:01:02 2019 +0100 patch 8.1.0711: test files still use function! Problem: Test files still use function!. Solution: Remove the exclamation mark. Fix overwriting a function.
author Bram Moolenaar <Bram@vim.org>
date Wed, 09 Jan 2019 23:15:05 +0100
parents 7f669f95356e
children e472308af17d
comparison
equal deleted inserted replaced
15405:3a8785d45112 15406:63b02fcf1361
1 " Test for options 1 " Test for options
2 2
3 function! Test_whichwrap() 3 func Test_whichwrap()
4 set whichwrap=b,s 4 set whichwrap=b,s
5 call assert_equal('b,s', &whichwrap) 5 call assert_equal('b,s', &whichwrap)
6 6
7 set whichwrap+=h,l 7 set whichwrap+=h,l
8 call assert_equal('b,s,h,l', &whichwrap) 8 call assert_equal('b,s,h,l', &whichwrap)
18 18
19 set whichwrap=h,h,h 19 set whichwrap=h,h,h
20 call assert_equal('h', &whichwrap) 20 call assert_equal('h', &whichwrap)
21 21
22 set whichwrap& 22 set whichwrap&
23 endfunction 23 endfunc
24 24
25 function! Test_isfname() 25 func Test_isfname()
26 " This used to cause Vim to access uninitialized memory. 26 " This used to cause Vim to access uninitialized memory.
27 set isfname= 27 set isfname=
28 call assert_equal("~X", expand("~X")) 28 call assert_equal("~X", expand("~X"))
29 set isfname& 29 set isfname&
30 endfunction 30 endfunc
31 31
32 function Test_wildchar() 32 func Test_wildchar()
33 " Empty 'wildchar' used to access invalid memory. 33 " Empty 'wildchar' used to access invalid memory.
34 call assert_fails('set wildchar=', 'E521:') 34 call assert_fails('set wildchar=', 'E521:')
35 call assert_fails('set wildchar=abc', 'E521:') 35 call assert_fails('set wildchar=abc', 'E521:')
36 set wildchar=<Esc> 36 set wildchar=<Esc>
37 let a=execute('set wildchar?') 37 let a=execute('set wildchar?')
38 call assert_equal("\n wildchar=<Esc>", a) 38 call assert_equal("\n wildchar=<Esc>", a)
39 set wildchar=27 39 set wildchar=27
40 let a=execute('set wildchar?') 40 let a=execute('set wildchar?')
41 call assert_equal("\n wildchar=<Esc>", a) 41 call assert_equal("\n wildchar=<Esc>", a)
42 set wildchar& 42 set wildchar&
43 endfunction 43 endfunc
44 44
45 function Test_options() 45 func Test_options()
46 let caught = 'ok' 46 let caught = 'ok'
47 try 47 try
48 options 48 options
49 catch 49 catch
50 let caught = v:throwpoint . "\n" . v:exception 50 let caught = v:throwpoint . "\n" . v:exception
51 endtry 51 endtry
52 call assert_equal('ok', caught) 52 call assert_equal('ok', caught)
53 53
54 " close option-window 54 " close option-window
55 close 55 close
56 endfunction 56 endfunc
57 57
58 function Test_path_keep_commas() 58 func Test_path_keep_commas()
59 " Test that changing 'path' keeps two commas. 59 " Test that changing 'path' keeps two commas.
60 set path=foo,,bar 60 set path=foo,,bar
61 set path-=bar 61 set path-=bar
62 set path+=bar 62 set path+=bar
63 call assert_equal('foo,,bar', &path) 63 call assert_equal('foo,,bar', &path)
64 64
65 set path& 65 set path&
66 endfunction 66 endfunc
67 67
68 func Test_signcolumn() 68 func Test_signcolumn()
69 if has('signs') 69 if has('signs')
70 call assert_equal("auto", &signcolumn) 70 call assert_equal("auto", &signcolumn)
71 set signcolumn=yes 71 set signcolumn=yes