mirror of
https://github.com/neovim/neovim.git
synced 2026-04-19 05:50:39 +00:00
test: include :cd in pcall() in rmdir() (#38278)
If the Nvim session has exited, the nvim_command will fail too.
ERROR test/functional/core/fileio_spec.lua @ 342: tmpdir failure modes
test\functional\testnvim.lua:133: sending request after EOF from Nvim
stack traceback:
test\functional\testnvim.lua:133: in function 'command'
test\functional\testnvim.lua:847: in function 'rmdir'
test/functional/core\fileio_spec.lua:353: in function <test/functional/core\fileio_spec.lua:342>
(cherry picked from commit b027de3a87)
This commit is contained in:
committed by
github-actions[bot]
parent
976db1ba4b
commit
8189bb8e48
@@ -807,8 +807,10 @@ function M.rmdir(path)
|
||||
if not ret and is_os('win') then
|
||||
-- Maybe "Permission denied"; try again after changing the nvim
|
||||
-- process to the top-level directory.
|
||||
M.command([[exe 'cd '.fnameescape(']] .. start_dir .. "')")
|
||||
ret, _ = pcall(vim.fs.rm, path, { recursive = true, force = true })
|
||||
ret, _ = pcall(function()
|
||||
M.command([[exe 'cd '.fnameescape(']] .. start_dir .. "')")
|
||||
vim.fs.rm(path, { recursive = true, force = true })
|
||||
end)
|
||||
end
|
||||
-- During teardown, the nvim process may not exit quickly enough, then rmdir()
|
||||
-- will fail (on Windows).
|
||||
|
||||
Reference in New Issue
Block a user