aboutsummaryrefslogtreecommitdiff
path: root/test/functional/helpers.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2015-09-19 09:15:25 -0400
committerJustin M. Keyes <justinkz@gmail.com>2015-09-19 09:15:25 -0400
commit2417aeebbffe58eab6ac39feac0f64a27aafbee2 (patch)
treeb40d06c213cc9fa609dc92881c198b84a3f8da04 /test/functional/helpers.lua
parente80d7c0df7ec6e88a964e58d86a70c8f980e4cc1 (diff)
parent924058c00fa85f042cc4a2b3b9cf284dffae8c27 (diff)
downloadrneovim-2417aeebbffe58eab6ac39feac0f64a27aafbee2.tar.gz
rneovim-2417aeebbffe58eab6ac39feac0f64a27aafbee2.tar.bz2
rneovim-2417aeebbffe58eab6ac39feac0f64a27aafbee2.zip
Merge pull request #3359 from ZyX-I/fix-msgpack
Fix crash in msgpackparse function
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r--test/functional/helpers.lua16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index 07e0809dbc..9cd1fd7ab3 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -324,6 +324,19 @@ local function rmdir(path)
return ret
end
+local exc_exec = function(cmd)
+ nvim_command(([[
+ try
+ execute "%s"
+ catch
+ let g:__exception = v:exception
+ endtry
+ ]]):format(cmd:gsub('\n', '\\n'):gsub('[\\"]', '\\%0')))
+ local ret = nvim_eval('get(g:, "__exception", 0)')
+ nvim_command('unlet! g:__exception')
+ return ret
+end
+
return {
clear = clear,
spawn = spawn,
@@ -358,5 +371,6 @@ return {
wait = wait,
set_session = set_session,
write_file = write_file,
- rmdir = rmdir
+ rmdir = rmdir,
+ exc_exec = exc_exec,
}