aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/vim_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2016-07-16 16:51:56 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2016-08-31 21:57:06 +0200
commitacb7c826b3df50bd9825baf3b2ffaaa79c8b80df (patch)
tree5ece44d718f6511d468ac4fe35030a795044999c /test/functional/api/vim_spec.lua
parent98a08c3e5a73dafb2e2f1246f1a2ddd9e071798d (diff)
downloadrneovim-acb7c826b3df50bd9825baf3b2ffaaa79c8b80df.tar.gz
rneovim-acb7c826b3df50bd9825baf3b2ffaaa79c8b80df.tar.bz2
rneovim-acb7c826b3df50bd9825baf3b2ffaaa79c8b80df.zip
api: fix leak when a api function is incorrectly called with a list.
This applies both to msgpack-rpc and eval.
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r--test/functional/api/vim_spec.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index 4195a614c3..351094567a 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -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)