blob: 7215772a001f9c0cee1869bad39138e627319079 [file] [log] [blame]
Bram Moolenaar8f79acd2016-01-01 14:48:20 +01001" Tests for the :set command
2
3function Test_set_backslash()
4 let isk_save = &isk
5
6 set isk=a,b,c
7 set isk+=d
8 call assert_equal('a,b,c,d', &isk)
9 set isk+=\\,e
10 call assert_equal('a,b,c,d,\,e', &isk)
11 set isk-=e
12 call assert_equal('a,b,c,d,\', &isk)
13 set isk-=\\
14 call assert_equal('a,b,c,d', &isk)
15
16 let &isk = isk_save
17endfunction
18
19function Test_set_add()
20 let wig_save = &wig
21
22 set wildignore=*.png,
23 set wildignore+=*.jpg
24 call assert_equal('*.png,*.jpg', &wig)
25
26 let &wig = wig_save
27endfunction
Bram Moolenaar6d91bcb2020-08-12 18:50:36 +020028
Dominique Pelle042414f2021-07-12 21:43:19 +020029
30" :set, :setlocal, :setglobal without arguments show values of options.
31func Test_set_no_arg()
32 set textwidth=79
33 let a = execute('set')
34 call assert_match("^\n--- Options ---\n.*textwidth=79\\>", a)
35 set textwidth&
36
37 setlocal textwidth=78
38 let a = execute('setlocal')
39 call assert_match("^\n--- Local option values ---\n.*textwidth=78\\>", a)
40 setlocal textwidth&
41
42 setglobal textwidth=77
43 let a = execute('setglobal')
44 call assert_match("^\n--- Global option values ---\n.*textwidth=77\\>", a)
45 setglobal textwidth&
46endfunc
47
Bram Moolenaar6d91bcb2020-08-12 18:50:36 +020048" vim: shiftwidth=2 sts=2 expandtab