neovim/test/functional/legacy/100_lispwords_spec.lua

48 lines
1.1 KiB
Lua
Raw Normal View History

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')
local source = helpers.source
local clear, expect = helpers.clear, helpers.expect
2015-02-20 08:21:43 -07:00
describe('lispwords', function()
2015-02-20 08:21:43 -07:00
setup(clear)
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)