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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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