Merge pull request #16983 from dundargoc/test/add-vimruntime-variable

test: add VIMRUNTIME variable to the clear function
This commit is contained in:
James McCoy
2022-01-08 19:31:37 -05:00
committed by GitHub
2 changed files with 2 additions and 5 deletions

View File

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

View File

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