neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

test_set.vim (1093B)


      1 " Tests for the :set command
      2 
      3 function 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
     17 endfunction
     18 
     19 function 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
     27 endfunction
     28 
     29 
     30 " :set, :setlocal, :setglobal without arguments show values of options.
     31 func 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&
     46 endfunc
     47 
     48 " vim: shiftwidth=2 sts=2 expandtab