aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-12-28 10:36:15 +0100
committerGitHub <noreply@github.com>2022-12-28 10:36:15 +0100
commite28907b69dbfbae6b4cf66a906533edc5cfe9844 (patch)
tree353f8090c91665586d0f1d227e3133c312f6d933 /tests
parentfix(libuv): shutdown -> close (#816) (diff)
downloadmason-e28907b69dbfbae6b4cf66a906533edc5cfe9844.tar
mason-e28907b69dbfbae6b4cf66a906533edc5cfe9844.tar.gz
mason-e28907b69dbfbae6b4cf66a906533edc5cfe9844.tar.bz2
mason-e28907b69dbfbae6b4cf66a906533edc5cfe9844.tar.lz
mason-e28907b69dbfbae6b4cf66a906533edc5cfe9844.tar.xz
mason-e28907b69dbfbae6b4cf66a906533edc5cfe9844.tar.zst
mason-e28907b69dbfbae6b4cf66a906533edc5cfe9844.zip
fix(powershell): terminate stdin with newline (#818)
Powershell doesn't seem to be closing the process after commands finsh executing and stdin is closed, not entirely sure why. This seems to fix the issue.
Diffstat (limited to 'tests')
-rw-r--r--tests/mason-core/managers/powershell_spec.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/mason-core/managers/powershell_spec.lua b/tests/mason-core/managers/powershell_spec.lua
index 0229388a..eb9de00f 100644
--- a/tests/mason-core/managers/powershell_spec.lua
+++ b/tests/mason-core/managers/powershell_spec.lua
@@ -76,7 +76,7 @@ describe("powershell manager", function()
powershell().script "echo 'Is this bash?'"
assert.spy(spawn.pwsh).was_called(1)
- assert.spy(vim.loop.write).was_called(4)
+ assert.spy(vim.loop.write).was_called(5)
assert
.spy(vim.loop.write)
.was_called_with(match.is_ref(stdin), [[ $ErrorActionPreference = "Stop"; ]], match.is_function())
@@ -89,6 +89,7 @@ describe("powershell manager", function()
match.is_function()
)
assert.spy(vim.loop.write).was_called_with(match.is_ref(stdin), "echo 'Is this bash?'", match.is_function())
+ assert.spy(vim.loop.write).was_called_with(match.is_ref(stdin), "\n", match.is_function())
assert.spy(vim.loop.shutdown).was_called(1)
assert.spy(vim.loop.shutdown).was_called_with(match.is_ref(stdin), match.is_function())
end)