aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/window_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/api/window_spec.lua')
-rw-r--r--test/functional/api/window_spec.lua15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/functional/api/window_spec.lua b/test/functional/api/window_spec.lua
index 456252522d..92a33b4cdb 100644
--- a/test/functional/api/window_spec.lua
+++ b/test/functional/api/window_spec.lua
@@ -1,10 +1,12 @@
-- Sanity checks for window_* API calls via msgpack-rpc
local helpers = require('test.functional.helpers')
-local clear, nvim, buffer, curbuf, curbuf_contents, window, curwin, eq, neq,
- ok, feed, rawfeed, insert, eval = helpers.clear, helpers.nvim, helpers.buffer, helpers.curbuf,
+local clear, nvim, curbuf, curbuf_contents, window, curwin, eq, neq,
+ ok, feed, insert, eval = helpers.clear, helpers.nvim, helpers.curbuf,
helpers.curbuf_contents, helpers.window, helpers.curwin, helpers.eq,
- helpers.neq, helpers.ok, helpers.feed, helpers.rawfeed, helpers.insert, helpers.eval
+ helpers.neq, helpers.ok, helpers.feed, helpers.insert, helpers.eval
local wait = helpers.wait
+local curwinmeths = helpers.curwinmeths
+local funcs = helpers.funcs
-- check if str is visible at the beginning of some line
local function is_visible(str)
@@ -54,7 +56,7 @@ describe('window_* functions', function()
insert("prologue")
feed('100o<esc>')
insert("epilogue")
- win = curwin()
+ local win = curwin()
feed('gg')
wait() -- let nvim process the 'gg' command
@@ -126,11 +128,14 @@ describe('window_* functions', function()
end)
end)
- describe('{get,set}_var', function()
+ describe('{get,set,del}_var', function()
it('works', function()
curwin('set_var', 'lua', {1, 2, {['3'] = 1}})
eq({1, 2, {['3'] = 1}}, curwin('get_var', 'lua'))
eq({1, 2, {['3'] = 1}}, nvim('eval', 'w:lua'))
+ eq(1, funcs.exists('w:lua'))
+ curwinmeths.del_var('lua')
+ eq(0, funcs.exists('w:lua'))
end)
end)