2015-12-17 01:55:34 -07:00
|
|
|
-- Tests for 'lispwords' setting being global-local
|
2015-02-20 08:21:43 -07:00
|
|
|
|
|
|
|
local helpers = require('test.functional.helpers')
|
2015-11-17 14:44:00 -07:00
|
|
|
local source = helpers.source
|
|
|
|
local clear, expect = helpers.clear, helpers.expect
|
2015-02-20 08:21:43 -07:00
|
|
|
|
2016-01-09 23:10:38 -07:00
|
|
|
describe('lispwords', function()
|
2015-02-20 08:21:43 -07:00
|
|
|
setup(clear)
|
|
|
|
|
2016-01-09 23:10:38 -07:00
|
|
|
it('global-local', function()
|
2015-02-20 08:21:43 -07:00
|
|
|
source([[
|
|
|
|
setglobal lispwords=foo,bar,baz
|
|
|
|
setlocal lispwords-=foo
|
|
|
|
setlocal lispwords+=quux
|
|
|
|
redir @A
|
|
|
|
echo "Testing 'lispwords' local value"
|
|
|
|
setglobal lispwords?
|
|
|
|
setlocal lispwords?
|
|
|
|
echo &lispwords
|
|
|
|
echo ''
|
|
|
|
redir end
|
|
|
|
setlocal lispwords<
|
|
|
|
redir @A
|
|
|
|
echo "Testing 'lispwords' value reset"
|
|
|
|
setglobal lispwords?
|
|
|
|
setlocal lispwords?
|
|
|
|
echo &lispwords
|
|
|
|
redir end
|
|
|
|
|
|
|
|
0put a
|
|
|
|
$d
|
|
|
|
]])
|
|
|
|
|
|
|
|
-- Assert buffer contents.
|
|
|
|
expect([[
|
|
|
|
|
|
|
|
Testing 'lispwords' local value
|
|
|
|
lispwords=foo,bar,baz
|
|
|
|
lispwords=bar,baz,quux
|
|
|
|
bar,baz,quux
|
|
|
|
|
|
|
|
Testing 'lispwords' value reset
|
|
|
|
lispwords=foo,bar,baz
|
|
|
|
lispwords=foo,bar,baz
|
|
|
|
foo,bar,baz]])
|
|
|
|
end)
|
|
|
|
end)
|