From 45a548d4329975c113ac0f225f98afcf5f2b0724 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 17 Aug 2019 11:04:25 +0800 Subject: improve process --- tests/modules/process/test.lua | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'tests/modules/process/test.lua') diff --git a/tests/modules/process/test.lua b/tests/modules/process/test.lua index c5ee27d9f..24846fd02 100644 --- a/tests/modules/process/test.lua +++ b/tests/modules/process/test.lua @@ -7,20 +7,14 @@ function test_single_process(t) local stdout = os.tmpfile() local stderr = os.tmpfile() for i = 1, 2 do - local pro = process.open("echo -n awd", {outpath = stdout, errpath = stderr}) - process.wait(pro, inftimeout) - process.close(pro) + local proc = process.open("echo -n awd", {outpath = stdout, errpath = stderr}) + proc:wait(inftimeout) + proc:close() t:are_equal(io.readfile(stdout), "awd") end end function test_hack(t) - -- hack test - t:will_raise(function () - process.wait("awd", inftimeout) - end) - - t:require_not(process.close("awd")) t:will_raise(function () process.waitlist("awd", inftimeout) -- cgit v1.3.1