set_spec.lua 798 B

12345678910111213141516171819202122232425262728293031
  1. -- Tests for :set
  2. local helpers = require('test.functional.helpers')(after_each)
  3. local clear, command, eval, eq =
  4. helpers.clear, helpers.command, helpers.eval, helpers.eq
  5. describe(':set', function()
  6. before_each(clear)
  7. it('handles backslash properly', function()
  8. command('set iskeyword=a,b,c')
  9. command('set iskeyword+=d')
  10. eq('a,b,c,d', eval('&iskeyword'))
  11. command([[set iskeyword+=\\,e]])
  12. eq([[a,b,c,d,\,e]], eval('&iskeyword'))
  13. command('set iskeyword-=e')
  14. eq([[a,b,c,d,\]], eval('&iskeyword'))
  15. command([[set iskeyword-=\]])
  16. eq('a,b,c,d', eval('&iskeyword'))
  17. end)
  18. it('recognizes a trailing comma with +=', function()
  19. command('set wildignore=*.png,')
  20. command('set wildignore+=*.jpg')
  21. eq('*.png,*.jpg', eval('&wildignore'))
  22. end)
  23. end)