diff options
author | ZyX <kp-pav@yandex.ru> | 2017-02-23 01:34:25 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-02-23 19:48:41 +0300 |
commit | 858ac9d8e5d971db3d6f770d386fc964187a78b4 (patch) | |
tree | 6e8fda441bdab09dd3f3343f5743fd8d5e644121 /test/functional/helpers.lua | |
parent | 8faa4af39673ac032362b62662eb049f588fef81 (diff) | |
download | rneovim-858ac9d8e5d971db3d6f770d386fc964187a78b4.tar.gz rneovim-858ac9d8e5d971db3d6f770d386fc964187a78b4.tar.bz2 rneovim-858ac9d8e5d971db3d6f770d386fc964187a78b4.zip |
api: Make sure dict_set_var doesn’t edit read-only values
Fixes #6147
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r-- | test/functional/helpers.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 53cbf8d4a1..14cab293ac 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -534,6 +534,14 @@ local function skip_fragile(pending_fn, cond) return false end +local function meth_pcall(...) + local ret = {pcall(...)} + if type(ret[2]) == 'string' then + ret[2] = ret[2]:gsub('^[^:]+:%d+: ', '') + end + return ret +end + local funcs = create_callindex(nvim_call) local meths = create_callindex(nvim) local uimeths = create_callindex(ui) @@ -604,6 +612,7 @@ local M = { skip_fragile = skip_fragile, set_shell_powershell = set_shell_powershell, tmpname = tmpname, + meth_pcall = meth_pcall, NIL = mpack.NIL, } |