mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
api: fix leak when a api function is incorrectly called with a list.
This applies both to msgpack-rpc and eval.
This commit is contained in:
@@ -303,4 +303,11 @@ describe('vim_* functions', function()
|
||||
eq(false, status)
|
||||
ok(err:match('Invalid option name') ~= nil)
|
||||
end)
|
||||
|
||||
it("doesn't leak memory on incorrect argument types", function()
|
||||
local status, err = pcall(nvim, 'change_directory',{'not', 'a', 'dir'})
|
||||
eq(false, status)
|
||||
ok(err:match(': Wrong type for argument 1, expecting String') ~= nil)
|
||||
end)
|
||||
|
||||
end)
|
||||
|
Reference in New Issue
Block a user