aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/tabpage_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2016-09-14 11:17:07 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2016-09-15 10:44:38 +0200
commitcd08e6cf72b52fb23aa4556889f35759062c5bf9 (patch)
treea581b0162b847d20f142706c9085bcf405cc0697 /test/functional/api/tabpage_spec.lua
parentc61bf43a90238f20716d48554ddc536b485ec1bf (diff)
downloadrneovim-cd08e6cf72b52fb23aa4556889f35759062c5bf9.tar.gz
rneovim-cd08e6cf72b52fb23aa4556889f35759062c5bf9.tar.bz2
rneovim-cd08e6cf72b52fb23aa4556889f35759062c5bf9.zip
api: make nvim[_obj]_set_var and _del_var not return the old value
Diffstat (limited to 'test/functional/api/tabpage_spec.lua')
-rw-r--r--test/functional/api/tabpage_spec.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/functional/api/tabpage_spec.lua b/test/functional/api/tabpage_spec.lua
index 7b97c7f067..5bb8f27223 100644
--- a/test/functional/api/tabpage_spec.lua
+++ b/test/functional/api/tabpage_spec.lua
@@ -5,6 +5,8 @@ local clear, nvim, tabpage, curtab, eq, ok =
helpers.ok
local curtabmeths = helpers.curtabmeths
local funcs = helpers.funcs
+local request = helpers.request
+local NIL = helpers.NIL
describe('tabpage_* functions', function()
before_each(clear)
@@ -32,6 +34,21 @@ describe('tabpage_* functions', function()
curtabmeths.del_var('lua')
eq(0, funcs.exists('t:lua'))
end)
+
+ it('tabpage_set_var returns the old value', function()
+ local val1 = {1, 2, {['3'] = 1}}
+ local val2 = {4, 7}
+ eq(NIL, request('tabpage_set_var', 0, 'lua', val1))
+ eq(val1, request('tabpage_set_var', 0, 'lua', val2))
+ end)
+
+ it('tabpage_del_var returns the old value', function()
+ local val1 = {1, 2, {['3'] = 1}}
+ local val2 = {4, 7}
+ eq(NIL, request('tabpage_set_var', 0, 'lua', val1))
+ eq(val1, request('tabpage_set_var', 0, 'lua', val2))
+ eq(val2, request('tabpage_del_var', 0, 'lua'))
+ end)
end)
describe('is_valid', function()