chore(tests): add test case for stdin passing to child

This commit is contained in:
Erica Marigold 2023-09-18 23:27:48 +05:30
parent 64266f8e8b
commit ad6b2a2364

View file

@ -138,3 +138,16 @@ assert(
echoResult.stdout == (echoMessage .. "\n"), -- Note that echo adds a newline
"Inheriting stdio did not return proper output"
)
-- Passing stdin strings should work
local stdinChild = process.spawn("xargs", {
"echo",
}, {
stdin = echoMessage,
})
assert(
stdinChild.stdout == (echoMessage .. "\n"), -- Note that echo adds a newline
"Stdin passing did not return proper output"
)