aboutsummaryrefslogtreecommitdiff
path: root/test/functional/helpers.lua
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-10-10 04:16:02 -0400
committerJustin M. Keyes <justinkz@gmail.com>2019-10-10 01:16:02 -0700
commit51f2826f617532aaf5d682dfc3229f3723427ce6 (patch)
tree673eab4cfa259774aebfcf5e3d849baa639e2d0f /test/functional/helpers.lua
parentf2ad93168b15dd808fff545cc8bec510cc020e0a (diff)
downloadrneovim-51f2826f617532aaf5d682dfc3229f3723427ce6.tar.gz
rneovim-51f2826f617532aaf5d682dfc3229f3723427ce6.tar.bz2
rneovim-51f2826f617532aaf5d682dfc3229f3723427ce6.zip
doc: update shellquote for powershell #11122
shellquote is not treated like shellxquote for non-quote values.
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r--test/functional/helpers.lua15
1 files changed, 13 insertions, 2 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index c195983e93..20371b8ab0 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -501,9 +501,20 @@ function module.source(code)
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
module.source([[
- set shell=powershell shellquote=( shellpipe=\| shellredir=> shellxquote=
- let &shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command Remove-Item -Force alias:sleep; Remove-Item -Force alias:cat;'
+ let &shell = ']]..shell..[['
+ set shellquote= shellpipe=\| shellxquote=
+ let &shellredir = '| Out-File -Encoding UTF8'
+ let &shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command ]]..cmd..[['
]])
end