From 37a8f1623592efbcb249d8ca0acd0c6167d37ed8 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Mon, 6 Jan 2025 14:27:53 +0100 Subject: wdye: enable waiting for processes --- tools/wdye/test.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tools/wdye/test.lua') diff --git a/tools/wdye/test.lua b/tools/wdye/test.lua index 5e2fe36..c255c72 100644 --- a/tools/wdye/test.lua +++ b/tools/wdye/test.lua @@ -18,7 +18,14 @@ expect(cat:regex {"A(.*)3", nocase=true, function (p) assert(p[1] == "bc12", "wrong regex group #1") end}) +assert(not cat:wait (true), "process reports exiting early") + -- Send EOF (^D), test method chaining. cat:send("Closing...\r"):send("\004") local v = expect(cat:eof {true}, cat:default {.5, function (p) error "expected EOF, got a timeout" end}) + +local s1, exit, signal = cat:wait () +assert(s1 == 0 and exit == 0 and not signal, "unexpected exit status") +local s2 = cat:wait (true) +assert(s1 == s2, "exit status not remembered") -- cgit v1.2.3-70-g09d2