chore(tests): windows support for process.spawn stream test

This commit is contained in:
Erica Marigold 2024-06-09 22:29:19 +05:30
parent d9cc71e512
commit f0906c98a2
No known key found for this signature in database
GPG key ID: 2768CC0C23D245D1

View file

@ -11,7 +11,10 @@ assert(
"Failed to write to stdin or read from stdout of child process"
)
local echoChild = process.spawn("echo", { msg, ">>/dev/stderr" }, { shell = true })
local echoChild = if process.os == "windows"
then process.spawn("Write-Error", { msg }, { shell = "powershell" })
else process.spawn("echo", { msg, ">>/dev/stderr" }, { shell = true })
assert(
msg == buffer.tostring(echoChild.stderr:read(#msg)),
"Failed to read from stderr of child process"