api: Replace set_var(name, NIL) with del_var(name)

This commit is contained in:
ZyX
2016-02-11 02:01:17 +03:00
parent af6603a6b4
commit f1ced96c28
11 changed files with 110 additions and 17 deletions

View File

@@ -3,6 +3,9 @@ local helpers = require('test.functional.helpers')
local clear, nvim, tabpage, curtab, eq, ok =
helpers.clear, helpers.nvim, helpers.tabpage, helpers.curtab, helpers.eq,
helpers.ok
local wait = helpers.wait
local curtabmeths = helpers.curtabmeths
local funcs = helpers.funcs
describe('tabpage_* functions', function()
before_each(clear)
@@ -21,11 +24,14 @@ describe('tabpage_* functions', function()
end)
end)
describe('{get,set}_var', function()
describe('{get,set,del}_var', function()
it('works', function()
curtab('set_var', 'lua', {1, 2, {['3'] = 1}})
eq({1, 2, {['3'] = 1}}, curtab('get_var', 'lua'))
eq({1, 2, {['3'] = 1}}, nvim('eval', 't:lua'))
eq(1, funcs.exists('t:lua'))
curtabmeths.del_var('lua')
eq(0, funcs.exists('t:lua'))
end)
end)