diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2025-01-06 14:27:53 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2025-01-06 14:29:41 +0100 |
commit | 37a8f1623592efbcb249d8ca0acd0c6167d37ed8 (patch) | |
tree | 24fbf880f5f613f35c5181724cf1e998e5c04f93 /tools/wdye/test.lua | |
parent | 9fe576ae9e7b641925168612b98a704967a04dd0 (diff) | |
download | liberty-37a8f1623592efbcb249d8ca0acd0c6167d37ed8.tar.gz liberty-37a8f1623592efbcb249d8ca0acd0c6167d37ed8.tar.xz liberty-37a8f1623592efbcb249d8ca0acd0c6167d37ed8.zip |
wdye: enable waiting for processes
Diffstat (limited to 'tools/wdye/test.lua')
-rw-r--r-- | tools/wdye/test.lua | 7 |
1 files changed, 7 insertions, 0 deletions
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") |