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:
Justin M. Keyes 2016-09-20 03:02:48 +02:00
parent 764f576d64
commit 13e5724621

View File

@ -424,15 +424,15 @@ local function do_rmdir(path)
end
end
end
local ret, err = os.remove(path)
local ret, err = lfs.rmdir(path)
if not ret then
error('os.remove: '..err)
error('lfs.rmdir('..path..'): '..err)
end
return ret
end
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()
-- will fail (on Windows).
if not ret then -- Try again.