aboutsummaryrefslogtreecommitdiff
path: root/test/functional/helpers.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-01-12 12:44:54 +0000
committerLewis Russell <lewis6991@gmail.com>2024-01-12 13:01:06 +0000
commitc30f2e3182e3b50e7c03932027ac55edfc8ada4a (patch)
treeedf0a76dba282d946f67fe70fff8c6cbe28e7a82 /test/functional/helpers.lua
parent284e0ad26dd9de90c3a813dd1b357a425eca6bad (diff)
downloadrneovim-c30f2e3182e3b50e7c03932027ac55edfc8ada4a.tar.gz
rneovim-c30f2e3182e3b50e7c03932027ac55edfc8ada4a.tar.bz2
rneovim-c30f2e3182e3b50e7c03932027ac55edfc8ada4a.zip
test: typing for helpers.meths
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r--test/functional/helpers.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index a31d2d5b44..dff4a7f13c 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -631,6 +631,9 @@ module.uimeths = module.create_callindex(ui)
local function create_api(request, call)
local m = {}
function m.nvim(method, ...)
+ if vim.startswith(method, 'nvim_') then
+ return request(method, ...)
+ end
return request('nvim_' .. method, ...)
end
@@ -700,6 +703,9 @@ module.describe_lua_and_rpc = function(describe)
end
end
+--- add for typing. The for loop after will overwrite this
+module.meths = vim.api
+
for name, fn in pairs(module.rpc.api) do
module[name] = fn
end
@@ -862,11 +868,11 @@ function module.skip_fragile(pending_fn, cond)
end
function module.exec(code)
- module.meths.exec2(code, {})
+ module.meths.nvim_exec2(code, {})
end
function module.exec_capture(code)
- return module.meths.exec2(code, { output = true }).output
+ return module.meths.nvim_exec2(code, { output = true }).output
end
--- @param code string