diff options
| author | Alexej Kowalew <616b2f@gmail.com> | 2025-04-12 17:24:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-12 08:24:42 -0700 |
| commit | d77d961b350da580c3fb71847b3eec7563273494 (patch) | |
| tree | 613f6cd1e65040e4d412783840827152290b7293 /test/functional/vimscript | |
| parent | c8fbb0d2ee05d05f5971b132c3b38cb0141db235 (diff) | |
feat(defaults): shelltemp=false #33012
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Diffstat (limited to 'test/functional/vimscript')
| -rw-r--r-- | test/functional/vimscript/system_spec.lua | 65 |
1 files changed, 44 insertions, 21 deletions
diff --git a/test/functional/vimscript/system_spec.lua b/test/functional/vimscript/system_spec.lua index 2813128aae..d568e71336 100644 --- a/test/functional/vimscript/system_spec.lua +++ b/test/functional/vimscript/system_spec.lua @@ -558,9 +558,12 @@ end) describe('shell :!', function() before_each(clear) - it(':{range}! with powershell filter/redirect #16271 #19250', function() + it(':{range}! with powershell using "commands" filter/redirect #16271 #19250', function() + if not n.has_powershell() then + return + end local screen = Screen.new(500, 8) - local found = n.set_shell_powershell(true) + n.set_shell_powershell() insert([[ 3 1 @@ -569,23 +572,44 @@ describe('shell :!', function() if is_os('win') then feed(':4verbose %!sort /R<cr>') screen:expect { - any = [[Executing command: .?& { Get%-Content .* | & sort /R } 2>&1 | %%{ "$_" } | Out%-File .*; exit $LastExitCode"]], + any = [[Executing command: " $input | sort /R".*]], } else feed(':4verbose %!sort -r<cr>') screen:expect { - any = [[Executing command: .?& { Get%-Content .* | & sort %-r } 2>&1 | %%{ "$_" } | Out%-File .*; exit $LastExitCode"]], + any = [[Executing command: " $input | sort %-r".*]], } end feed('<CR>') - if found then - -- Not using fake powershell, so we can test the result. - expect([[ - 4 - 3 - 2 - 1]]) + expect([[ + 4 + 3 + 2 + 1]]) + end) + + it(':{range}! with powershell using "cmdlets" filter/redirect #16271 #19250', function() + if not n.has_powershell() then + pending('powershell not found', function() end) + return end + local screen = Screen.new(500, 8) + n.set_shell_powershell() + insert([[ + 3 + 1 + 4 + 2]]) + feed(':4verbose %!Sort-Object -Descending<cr>') + screen:expect { + any = [[Executing command: " $input | Sort%-Object %-Descending".*]], + } + feed('<CR>') + expect([[ + 4 + 3 + 2 + 1]]) end) it(':{range}! without redirecting to buffer', function() @@ -596,20 +620,19 @@ describe('shell :!', function() 4 2]]) feed(':4verbose %w !sort<cr>') - if is_os('win') then - screen:expect { - any = [[Executing command: .?sort %< .*]], - } - else - screen:expect { - any = [[Executing command: .?%(sort%) %< .*]], - } - end + screen:expect { + any = [[Executing command: "sort".*]], + } feed('<CR>') + + if not n.has_powershell() then + return + end + n.set_shell_powershell(true) feed(':4verbose %w !sort<cr>') screen:expect { - any = [[Executing command: .?& { Get%-Content .* | & sort }]], + any = [[Executing command: " $input | sort".*]], } feed('<CR>') n.expect_exit(command, 'qall!') |
