aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/system_spec.lua
diff options
context:
space:
mode:
authorDimitri Tcaciuc <dtcaciuc@users.noreply.github.com>2021-07-02 05:15:40 -0700
committerGitHub <noreply@github.com>2021-07-02 08:15:40 -0400
commit8b0765390292961aa0ec22e9931885c6d947c5e6 (patch)
tree42ae5afac31f865b16cce6c63c4b7d1628c86811 /test/functional/eval/system_spec.lua
parent7d8202087bed0a0baefb61557fcea15087fb01b3 (diff)
downloadrneovim-8b0765390292961aa0ec22e9931885c6d947c5e6.tar.gz
rneovim-8b0765390292961aa0ec22e9931885c6d947c5e6.tar.bz2
rneovim-8b0765390292961aa0ec22e9931885c6d947c5e6.zip
doc(options): Fix recommended PowerShell config (#14349)
Ensure that * Shell uses UTF8 input/output mode * Stderr output is captured, in UTF8 * Program exit codes are correctly captured Update functional test harness and add tests for :make command. Closes #13713
Diffstat (limited to 'test/functional/eval/system_spec.lua')
-rw-r--r--test/functional/eval/system_spec.lua31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/functional/eval/system_spec.lua b/test/functional/eval/system_spec.lua
index 8b18eff451..c374baf695 100644
--- a/test/functional/eval/system_spec.lua
+++ b/test/functional/eval/system_spec.lua
@@ -174,6 +174,21 @@ describe('system()', function()
end)
end
+ it('works with powershell w/ UTF-8 text (#13713)', function()
+ if not helpers.has_powershell() then
+ pending("not tested; powershell was not found", function() end)
+ return
+ end
+ -- Should work with recommended config used in helper
+ helpers.set_shell_powershell()
+ eq('ああ\n', eval([[system('Write-Output "ああ"')]]))
+ -- Sanity test w/ default encoding
+ -- * on Windows, expected to default to Western European enc
+ -- * on Linux, expected to default to UTF8
+ command([[let &shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command ']])
+ eq(iswin() and '??\n' or 'ああ\n', eval([[system('Write-Output "ああ"')]]))
+ end)
+
it('`echo` and waits for its return', function()
feed(':call system("echo")<cr>')
screen:expect([[
@@ -554,4 +569,20 @@ describe('systemlist()', function()
assert(out[1]:sub(0, 5) == 'pid: ', out)
os_kill(out[1]:match("%d+"))
end)
+
+ it('works with powershell w/ UTF-8 text (#13713)', function()
+ if not helpers.has_powershell() then
+ pending("not tested; powershell was not found", function() end)
+ return
+ end
+ -- Should work with recommended config used in helper
+ helpers.set_shell_powershell()
+ eq({iswin() and 'あ\r' or 'あ'}, eval([[systemlist('Write-Output あ')]]))
+ -- Sanity test w/ default encoding
+ -- * on Windows, expected to default to Western European enc
+ -- * on Linux, expected to default to UTF8
+ command([[let &shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command ']])
+ eq({iswin() and '?\r' or 'あ'}, eval([[systemlist('Write-Output あ')]]))
+ end)
+
end)