blob: 8e9e45bd89748e431b43fdb9e3c039e251f9b224 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
local inftimeout = 5000
function test_single_process(t)
-- single process test
local stdout = os.tmpfile()
local stderr = os.tmpfile()
for i = 1, 2 do
local proc = process.open("echo -n awd", {stdout = stdout, stderr = stderr})
proc:wait(inftimeout)
proc:close()
t:are_equal(io.readfile(stdout), "awd")
end
end
function test_hack(t)
t:will_raise(function ()
process.waitlist("awd", inftimeout)
end)
t:will_raise(function ()
process.waitlist({}, inftimeout)
end)
t:will_raise(function ()
process.waitlist({"awd"}, inftimeout)
end)
end
|