diff options
| author | ruki <[email protected]> | 2019-08-17 11:04:25 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-08-17 11:04:25 +0800 |
| commit | 45a548d4329975c113ac0f225f98afcf5f2b0724 (patch) | |
| tree | b38458c965b21ce78eee5bc04f9019cd375a350c /tests/modules/process | |
| parent | 1de49ce846981a065ce3bea73591b797718ae993 (diff) | |
improve process
Diffstat (limited to 'tests/modules/process')
| -rw-r--r-- | tests/modules/process/test.lua | 12 |
1 files changed, 3 insertions, 9 deletions
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) |
