refactor(test): drop deprecated exc_exec #39242

This commit is contained in:
Justin M. Keyes
2026-04-20 14:16:41 -04:00
committed by GitHub
parent faa7c15b5a
commit 4ceca862fc
77 changed files with 1009 additions and 799 deletions

View File

@@ -9,6 +9,7 @@ local SocketStream = uv_stream.SocketStream
local ProcStream = uv_stream.ProcStream
local check_cores = t.check_cores
local pcall_err = t.pcall_err
local check_logs = t.check_logs
local dedent = t.dedent
local eq = t.eq
@@ -864,20 +865,6 @@ function M.rmdir(path)
end
end
--- @deprecated Use `t.pcall_err()` to check failure, or `n.command()` to check success.
function M.exc_exec(cmd)
M.command(([[
try
execute "%s"
catch
let g:__exception = v:exception
endtry
]]):format(cmd:gsub('\n', '\\n'):gsub('[\\"]', '\\%0')))
local ret = M.eval('get(g:, "__exception", 0)')
M.command('unlet! g:__exception')
return ret
end
function M.exec(code)
M.api.nvim_exec2(code, {})
end