mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +00:00
test: Rename meth_pcall to pcall_err
- Rename `meth_pcall`. - Make `pcall_err` raise an error if the function does not fail. - Add `vim.pesc()` to treat a string as literal where a Lua pattern is expected.
This commit is contained in:
@@ -687,14 +687,6 @@ function module.skip_fragile(pending_fn, cond)
|
||||
return false
|
||||
end
|
||||
|
||||
function module.meth_pcall(...)
|
||||
local ret = {pcall(...)}
|
||||
if type(ret[2]) == 'string' then
|
||||
ret[2] = ret[2]:gsub('^[^:]+:%d+: ', '')
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
module.funcs = module.create_callindex(module.call)
|
||||
module.meths = module.create_callindex(module.nvim)
|
||||
module.uimeths = module.create_callindex(ui)
|
||||
|
Reference in New Issue
Block a user