mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
test/helpers.rmdir(): lfs.rmdir() instead of os.remove()
os.remove() fails on empty directories in non-POSIX systems. https://github.com/keplerproject/luafilesystem/issues/4 lfs.rmdir() "usually" works, so use it instead. Closes #5236
This commit is contained in:
parent
764f576d64
commit
13e5724621
@ -424,15 +424,15 @@ local function do_rmdir(path)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local ret, err = os.remove(path)
|
local ret, err = lfs.rmdir(path)
|
||||||
if not ret then
|
if not ret then
|
||||||
error('os.remove: '..err)
|
error('lfs.rmdir('..path..'): '..err)
|
||||||
end
|
end
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
local function rmdir(path)
|
local function rmdir(path)
|
||||||
local ret, err = pcall(do_rmdir, path)
|
local ret, _ = pcall(do_rmdir, path)
|
||||||
-- During teardown, the nvim process may not exit quickly enough, then rmdir()
|
-- During teardown, the nvim process may not exit quickly enough, then rmdir()
|
||||||
-- will fail (on Windows).
|
-- will fail (on Windows).
|
||||||
if not ret then -- Try again.
|
if not ret then -- Try again.
|
||||||
|
Loading…
Reference in New Issue
Block a user