diff options
author | Enan Ajmain <3nan.ajmain@gmail.com> | 2022-07-19 02:26:09 +0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-18 13:26:09 -0700 |
commit | 3340728c723833c093527b719b25c1cc9efaf598 (patch) | |
tree | 12563e1364c0b83f8574f83c9b24be506ca4dbc1 /test/functional/vimscript/system_spec.lua | |
parent | d73c31a41f9a6807b32ce0292836318402a5f4af (diff) | |
download | rneovim-3340728c723833c093527b719b25c1cc9efaf598.tar.gz rneovim-3340728c723833c093527b719b25c1cc9efaf598.tar.bz2 rneovim-3340728c723833c093527b719b25c1cc9efaf598.zip |
fix(powershell): filter ":!" commands with args #19268
Problem:
Since 0b9664f5240be4d9e9d6882fcd398970fd3a9532 powershell filtered
:[range]! commands with args causes error:
"Start-Process: A positional parameter cannot be found that accepts argument ..."
Solution:
Pass args to Start-Process via `-ArgumentList`.
closes #19250
Diffstat (limited to 'test/functional/vimscript/system_spec.lua')
-rw-r--r-- | test/functional/vimscript/system_spec.lua | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/test/functional/vimscript/system_spec.lua b/test/functional/vimscript/system_spec.lua index c915556c57..a778e2f435 100644 --- a/test/functional/vimscript/system_spec.lua +++ b/test/functional/vimscript/system_spec.lua @@ -630,7 +630,7 @@ end) describe('shell :!', function() before_each(clear) - it(':{range}! with powershell filter/redirect #16271', function() + it(':{range}! with powershell filter/redirect #16271 #19250', function() local screen = Screen.new(500, 8) screen:attach() local found = helpers.set_shell_powershell(true) @@ -639,18 +639,25 @@ describe('shell :!', function() 1 4 2]]) - feed(':4verbose %!sort<cr>') - screen:expect{ - any=[[Executing command: .?Start%-Process sort %-RedirectStandardInput .* %-RedirectStandardOutput .* %-NoNewWindow %-Wait]] - } + if iswin() then + feed(':4verbose %!sort /R<cr>') + screen:expect{ + any=[[Executing command: .?Start%-Process sort %-ArgumentList "/R" %-RedirectStandardInput .* %-RedirectStandardOutput .* %-NoNewWindow %-Wait]] + } + else + feed(':4verbose %!sort -r<cr>') + screen:expect{ + any=[[Executing command: .?Start%-Process sort %-ArgumentList "%-r" %-RedirectStandardInput .* %-RedirectStandardOutput .* %-NoNewWindow %-Wait]] + } + end feed('<CR>') if found then -- Not using fake powershell, so we can test the result. expect([[ - 1 - 2 + 4 3 - 4]]) + 2 + 1]]) end end) end) |