aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/helpers.lua4
-rw-r--r--test/functional/vimscript/system_spec.lua28
2 files changed, 30 insertions, 2 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index d31d337b63..2018f80052 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -525,9 +525,9 @@ function module.set_shell_powershell()
module.exec([[
let &shell = ']]..shell..[['
set shellquote= shellxquote=
- let &shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
- let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
let &shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command ]]..cmd..[['
+ let &shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
+ let &shellredir = '-RedirectStandardOutput %s -NoNewWindow -Wait'
]])
end
diff --git a/test/functional/vimscript/system_spec.lua b/test/functional/vimscript/system_spec.lua
index 9cc6424d31..dd1ac694e7 100644
--- a/test/functional/vimscript/system_spec.lua
+++ b/test/functional/vimscript/system_spec.lua
@@ -6,6 +6,8 @@ local eq, call, clear, eval, feed_command, feed, nvim =
helpers.eq, helpers.call, helpers.clear, helpers.eval, helpers.feed_command,
helpers.feed, helpers.nvim
local command = helpers.command
+local insert = helpers.insert
+local expect = helpers.expect
local exc_exec = helpers.exc_exec
local iswin = helpers.iswin
local os_kill = helpers.os_kill
@@ -630,3 +632,29 @@ describe('systemlist()', function()
end)
end)
+
+it(':{range}! works with powershell for filter and redirection #16271', function()
+ clear()
+ if not helpers.has_powershell() then
+ pending("not tested; powershell was not found", function() end)
+ return
+ end
+ local screen = Screen.new(500, 8)
+ screen:attach()
+ helpers.set_shell_powershell()
+ insert([[
+ 3
+ 1
+ 4
+ 2]])
+ feed(':4verbose %!sort<cr>')
+ screen:expect{
+ any=[[Executing command: "Start%-Process sort %-RedirectStandardInput .* %-RedirectStandardOutput .* %-NoNewWindow %-Wait".*4 lines filtered.*Press ENTER or type command to continue]]
+ }
+ feed('<CR>')
+ expect([[
+ 1
+ 2
+ 3
+ 4]])
+end)