aboutsummaryrefslogtreecommitdiff
path: root/test/functional/helpers.lua
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-10-11 00:30:20 -0400
committerJustin M. Keyes <justinkz@gmail.com>2019-10-10 21:30:20 -0700
commita7fc2f3f64f05ffd2a97c8ccf2e5c74d905ac808 (patch)
treebde48b36336c865218f6ac0f8d1e3bba8a3dc03e /test/functional/helpers.lua
parentb772b86d2ba256a2c03ab701d00b322cf52560e0 (diff)
downloadrneovim-a7fc2f3f64f05ffd2a97c8ccf2e5c74d905ac808.tar.gz
rneovim-a7fc2f3f64f05ffd2a97c8ccf2e5c74d905ac808.tar.bz2
rneovim-a7fc2f3f64f05ffd2a97c8ccf2e5c74d905ac808.zip
test: "!:&" works with powershell #11201
Removed 'echo' alias because it does not behave like POSIX echo.
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r--test/functional/helpers.lua12
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=