Skip to content

Commit

Permalink
Added test of stderr output event and writing to the process stdin
Browse files Browse the repository at this point in the history
  • Loading branch information
xomachine committed Jun 19, 2023
1 parent 5544aca commit c035a50
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lua/subprocess.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,13 @@ describe("vis.communicate", function ()
local handle = vis:communicate("termtest", "sleep 1s")
handle:close()
end)
it("process input/stderr", function()
event_assert("inputtest", "STDERR", "testdata\n")
event_assert("inputtest", "EXIT", 0)
local handle = vis:communicate("inputtest", "read n; echo $n 1>&2")
handle:write("testdata\n")
handle:flush()
-- do not close handle because it is being closed automaticaly
-- when process quits
end)
end)

0 comments on commit c035a50

Please sign in to comment.