test: add VIMRUNTIME variable to the clear function

Some of the tests will fail if this isn't explicitly set.
This commit is contained in:
Dundar Göc 2022-01-07 22:37:41 +01:00
parent 3088ac71f9
commit 14ec38bcf9
2 changed files with 2 additions and 5 deletions

View File

@ -668,11 +668,7 @@ describe('runtime:', function()
mkdir_p(ftdetect_folder)
write_file(ftdetect_file , [[vim.g.lua_ftdetect = 1]])
-- TODO(shadmansaleh): Figure out why this test fails without
-- setting VIMRUNTIME
clear{ args_rm={'-u'}, env={XDG_CONFIG_HOME=xconfig,
XDG_DATA_HOME=xdata,
VIMRUNTIME='runtime/'}}
clear{ args_rm={'-u'}, env=xenv }
eq(1, eval('g:lua_ftdetect'))
rmdir(ftdetect_folder)

View File

@ -451,6 +451,7 @@ function module.new_argv(...)
'GCOV_ERROR_FILE',
'XDG_DATA_DIRS',
'TMPDIR',
'VIMRUNTIME',
}) do
if not env_tbl[k] then
env_tbl[k] = os.getenv(k)