test: fix dependencies between test cases

Discovered using --shuffle argument of busted.

(cherry picked from commit f273a5a529)
This commit is contained in:
zeertzjq
2023-04-27 12:11:20 +08:00
committed by github-actions[bot]
parent 5c26f463bb
commit 1d9ef90115
9 changed files with 49 additions and 36 deletions

View File

@@ -137,12 +137,16 @@ describe('executable() (Windows)', function()
end)
it('system([…]), jobstart([…]) use $PATHEXT #9569', function()
-- Empty $PATHEXT defaults to ".com;.exe;.bat;.cmd".
clear({env={PATHEXT=''}})
-- Invoking `cmdscript` should find/execute `cmdscript.cmd`.
eq('much success\n', call('system', {'test/functional/fixtures/cmdscript'}))
assert(0 < call('jobstart', {'test/functional/fixtures/cmdscript'}))
end)
it('full path with extension', function()
-- Empty $PATHEXT defaults to ".com;.exe;.bat;.cmd".
clear({env={PATHEXT=''}})
-- Some executable we can expect in the test env.
local exe = 'printargs-test'
local exedir = eval("fnamemodify(v:progpath, ':h')")
@@ -153,6 +157,8 @@ describe('executable() (Windows)', function()
end)
it('full path without extension', function()
-- Empty $PATHEXT defaults to ".com;.exe;.bat;.cmd".
clear({env={PATHEXT=''}})
-- Some executable we can expect in the test env.
local exe = 'printargs-test'
local exedir = eval("fnamemodify(v:progpath, ':h')")