From c035a5092c82c86b5f7d72ab05ba12039dbf56a7 Mon Sep 17 00:00:00 2001 From: xomachine Date: Wed, 28 Feb 2018 20:02:15 +0300 Subject: [PATCH] Added test of stderr output event and writing to the process stdin --- lua/subprocess.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lua/subprocess.lua b/lua/subprocess.lua index 39ba7a9..0329122 100644 --- a/lua/subprocess.lua +++ b/lua/subprocess.lua @@ -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)