diff options
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r-- | test/functional/helpers.lua | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 20371b8ab0..2473fc0d3b 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -502,14 +502,10 @@ end function module.set_shell_powershell() local shell = iswin() and 'powershell' or 'pwsh' - if not module.eval('executable("'..shell..'")') then - error(shell..' is not executable') - end - local aliases = iswin() and {'cat', 'sleep'} or {} - local cmd = '' - for _, alias in ipairs(aliases) do - cmd = cmd .. 'Remove-Item -Force alias:' .. alias .. ';' - end + assert(module.eval('executable("'..shell..'")')) + local cmd = 'Remove-Item -Force '..table.concat(iswin() + and {'alias:cat', 'alias:echo', 'alias:sleep'} + or {'alias:echo'}, ',')..';' module.source([[ let &shell = ']]..shell..[[' set shellquote= shellpipe=\| shellxquote= |