tests: test presence of all signals
This commit is contained in:
parent
c85b11835c
commit
51192ad58f
1 changed files with 28 additions and 3 deletions
29
test.lua
29
test.lua
|
@ -192,9 +192,34 @@ fs.remove("%s")]]):format(
|
|||
return 'process.pidof("' .. proc .. '")'
|
||||
end,
|
||||
signum = function ()
|
||||
local sig = "SIGKILL"
|
||||
local sigs = {
|
||||
"SIGABRT",
|
||||
"SIGALRM",
|
||||
"SIGBUS",
|
||||
"SIGCHLD",
|
||||
"SIGCONT",
|
||||
"SIGFPE",
|
||||
"SIGHUP",
|
||||
"SIGILL",
|
||||
"SIGINT",
|
||||
"SIGKILL",
|
||||
"SIGPIPE",
|
||||
"SIGQUIT",
|
||||
"SIGSEGV",
|
||||
"SIGSTOP",
|
||||
"SIGTERM",
|
||||
"SIGTSTP",
|
||||
"SIGTTIN",
|
||||
"SIGTTOU",
|
||||
"SIGTRAP",
|
||||
"SIGURG",
|
||||
"SIGUSR1",
|
||||
"SIGUSR2"
|
||||
}
|
||||
|
||||
for _, sig in ipairs(sigs) do
|
||||
assert(math.type(process.signum(sig)) == "integer")
|
||||
end
|
||||
|
||||
-- https://todo.sr.ht/~jeremy/callisto/2
|
||||
local ok, err = pcall(function ()
|
||||
|
@ -203,7 +228,7 @@ fs.remove("%s")]]):format(
|
|||
assert(not ok)
|
||||
assert(err:find("no such signal$"))
|
||||
|
||||
return 'process.signum("' .. sig .. '")'
|
||||
return 'process.signum("' .. sigs[#sigs] .. '")'
|
||||
end,
|
||||
send = function ()
|
||||
local hdl = io.popen("sleep 2")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue