aboutsummaryrefslogtreecommitdiff
path: root/test/helpers.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2023-04-03 12:01:23 +0100
committerLewis Russell <lewis6991@gmail.com>2023-04-14 12:41:57 +0100
commit3d29424fb9960085f09f7e322abf204eab9287b9 (patch)
treec1ee3fb73d65f8c0b019549b30f7ebc755acf98b /test/helpers.lua
parent5465adcbab29b57d497d7260c6f85ddbf76c43ab (diff)
downloadrneovim-3d29424fb9960085f09f7e322abf204eab9287b9.tar.gz
rneovim-3d29424fb9960085f09f7e322abf204eab9287b9.tar.bz2
rneovim-3d29424fb9960085f09f7e322abf204eab9287b9.zip
refactor(unit): add type annotations
Diffstat (limited to 'test/helpers.lua')
-rw-r--r--test/helpers.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/helpers.lua b/test/helpers.lua
index 34c2036798..8f06311a3c 100644
--- a/test/helpers.lua
+++ b/test/helpers.lua
@@ -20,12 +20,16 @@ local module = {
REMOVE_THIS = {},
}
+--- @param p string
+--- @return string
local function relpath(p)
p = vim.fs.normalize(p)
local cwd = luv.cwd()
return p:gsub("^" .. cwd)
end
+--- @param path string
+--- @return boolean
function module.isdir(path)
if not path then
return false
@@ -37,6 +41,8 @@ function module.isdir(path)
return stat.type == 'directory'
end
+--- @param path string
+--- @return boolean
function module.isfile(path)
if not path then
return false
@@ -48,6 +54,7 @@ function module.isfile(path)
return stat.type == 'file'
end
+--- @return string
function module.argss_to_cmd(...)
local cmd = ''
for i = 1, select('#', ...) do
@@ -462,6 +469,7 @@ function module.check_cores(app, force) -- luacheck: ignore
end
end
+--- @return string?
function module.repeated_read_cmd(...)
for _ = 1, 10 do
local stream = module.popen_r(...)
@@ -561,6 +569,9 @@ function module.concat_tables(...)
return ret
end
+--- @param str string
+--- @param leave_indent? boolean
+--- @return string
function module.dedent(str, leave_indent)
-- find minimum common indent across lines
local indent = nil