test: fix flaky tests

This commit is contained in:
Steven Arcangeli 2023-11-19 19:40:20 -08:00
parent af04969c43
commit 4df43ad5f5
5 changed files with 31 additions and 21 deletions

View file

@ -143,7 +143,10 @@ M.shorten_path = function(path, relative_to)
return relpath or path
end
M.mkdirp = function(dir)
---@param dir string
---@param mode? integer
M.mkdirp = function(dir, mode)
mode = mode or 493
local mod = ""
local path = dir
while vim.fn.isdirectory(path) == 0 do
@ -153,7 +156,7 @@ M.mkdirp = function(dir)
while mod ~= "" do
mod = mod:sub(3)
path = vim.fn.fnamemodify(dir, mod)
uv.fs_mkdir(path, 493)
uv.fs_mkdir(path, mode)
end
end