test: fixed helper function to delete test directory

This commit is contained in:
Folke Lemaitre 2023-01-07 22:52:49 +01:00
parent d34c85d580
commit ad00eb1be2
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
3 changed files with 8 additions and 7 deletions

View file

@ -262,7 +262,7 @@ function M.find_root(modname)
if M.cache[modname] then
-- check if modname is in cache
local modpath = M.cache[modname].modpath
if M.check_path(modname, modpath) and vim.loop.fs_stat(modpath) then
if M.check_path(modname, modpath) and uv.fs_stat(modpath) then
local root = modpath:gsub("/init%.lua$", ""):gsub("%.lua$", "")
return root
end
@ -271,7 +271,7 @@ function M.find_root(modname)
-- check for any children in the cache
for child, entry in pairs(M.cache) do
if child:find(modname, 1, true) == 1 then
if M.check_path(child, entry.modpath) and vim.loop.fs_stat(entry.modpath) then
if M.check_path(child, entry.modpath) and uv.fs_stat(entry.modpath) then
local basename = modname:gsub("%.", "/")
local childbase = child:gsub("%.", "/")
local ret = entry.modpath:gsub("/init%.lua$", ""):gsub("%.lua$", "")