test: fix vimscript/server_spec leaving behind a dir (#28204)

This commit is contained in:
zeertzjq
2024-04-06 15:19:13 +08:00
committed by GitHub
parent f4df49a959
commit 406ff52824

View File

@@ -7,6 +7,7 @@ local matches = helpers.matches
local pcall_err = helpers.pcall_err local pcall_err = helpers.pcall_err
local check_close = helpers.check_close local check_close = helpers.check_close
local mkdir = helpers.mkdir local mkdir = helpers.mkdir
local rmdir = helpers.rmdir
local is_os = helpers.is_os local is_os = helpers.is_os
local testlog = 'Xtest-server-log' local testlog = 'Xtest-server-log'
@@ -26,6 +27,9 @@ describe('server', function()
it('serverstart() stores sockets in $XDG_RUNTIME_DIR', function() it('serverstart() stores sockets in $XDG_RUNTIME_DIR', function()
local dir = 'Xtest_xdg_run' local dir = 'Xtest_xdg_run'
mkdir(dir) mkdir(dir)
finally(function()
rmdir(dir)
end)
clear({ env = { XDG_RUNTIME_DIR = dir } }) clear({ env = { XDG_RUNTIME_DIR = dir } })
matches(dir, fn.stdpath('run')) matches(dir, fn.stdpath('run'))
if not is_os('win') then if not is_os('win') then