mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
api: make nvim[_obj]_set_var and _del_var not return the old value
This commit is contained in:
@@ -7,6 +7,8 @@ local clear, nvim, curbuf, curbuf_contents, window, curwin, eq, neq,
|
||||
local wait = helpers.wait
|
||||
local curwinmeths = helpers.curwinmeths
|
||||
local funcs = helpers.funcs
|
||||
local request = helpers.request
|
||||
local NIL = helpers.NIL
|
||||
|
||||
-- check if str is visible at the beginning of some line
|
||||
local function is_visible(str)
|
||||
@@ -137,6 +139,21 @@ describe('window_* functions', function()
|
||||
curwinmeths.del_var('lua')
|
||||
eq(0, funcs.exists('w:lua'))
|
||||
end)
|
||||
|
||||
it('window_set_var returns the old value', function()
|
||||
local val1 = {1, 2, {['3'] = 1}}
|
||||
local val2 = {4, 7}
|
||||
eq(NIL, request('window_set_var', 0, 'lua', val1))
|
||||
eq(val1, request('window_set_var', 0, 'lua', val2))
|
||||
end)
|
||||
|
||||
it('window_del_var returns the old value', function()
|
||||
local val1 = {1, 2, {['3'] = 1}}
|
||||
local val2 = {4, 7}
|
||||
eq(NIL, request('window_set_var', 0, 'lua', val1))
|
||||
eq(val1, request('window_set_var', 0, 'lua', val2))
|
||||
eq(val2, request('window_del_var', 0, 'lua'))
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('{get,set}_option', function()
|
||||
|
||||
Reference in New Issue
Block a user