2016-01-28 11:28:15 -07:00
|
|
|
-- Tests for :set
|
|
|
|
|
2016-04-23 16:53:11 -07:00
|
|
|
local helpers = require('test.functional.helpers')(after_each)
|
2017-04-08 14:12:26 -07:00
|
|
|
local clear, command, eval, eq =
|
|
|
|
helpers.clear, helpers.command, helpers.eval, helpers.eq
|
2016-01-28 11:28:15 -07:00
|
|
|
|
|
|
|
describe(':set', function()
|
|
|
|
before_each(clear)
|
|
|
|
|
2016-05-10 18:24:15 -07:00
|
|
|
it('handles backslash properly', function()
|
2017-04-08 14:12:26 -07:00
|
|
|
command('set iskeyword=a,b,c')
|
|
|
|
command('set iskeyword+=d')
|
2016-05-10 18:24:15 -07:00
|
|
|
eq('a,b,c,d', eval('&iskeyword'))
|
|
|
|
|
2017-04-08 14:12:26 -07:00
|
|
|
command([[set iskeyword+=\\,e]])
|
2016-05-10 18:24:15 -07:00
|
|
|
eq([[a,b,c,d,\,e]], eval('&iskeyword'))
|
|
|
|
|
2017-04-08 14:12:26 -07:00
|
|
|
command('set iskeyword-=e')
|
2016-05-10 18:24:15 -07:00
|
|
|
eq([[a,b,c,d,\]], eval('&iskeyword'))
|
|
|
|
|
2017-04-08 14:12:26 -07:00
|
|
|
command([[set iskeyword-=\]])
|
2016-05-10 18:24:15 -07:00
|
|
|
eq('a,b,c,d', eval('&iskeyword'))
|
|
|
|
end)
|
|
|
|
|
2016-01-28 11:28:15 -07:00
|
|
|
it('recognizes a trailing comma with +=', function()
|
2017-04-08 14:12:26 -07:00
|
|
|
command('set wildignore=*.png,')
|
|
|
|
command('set wildignore+=*.jpg')
|
2016-01-28 11:28:15 -07:00
|
|
|
eq('*.png,*.jpg', eval('&wildignore'))
|
|
|
|
end)
|
|
|
|
end)
|