From ad6b2a2364d59f3cb37aa93e15e075d99eb2f1c1 Mon Sep 17 00:00:00 2001 From: Erica Marigold Date: Mon, 18 Sep 2023 23:27:48 +0530 Subject: [PATCH] chore(tests): add test case for stdin passing to child --- tests/process/spawn.luau | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/process/spawn.luau b/tests/process/spawn.luau index c3537df..bcdf577 100644 --- a/tests/process/spawn.luau +++ b/tests/process/spawn.luau @@ -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" +)