tests: add test for passing an invalid signal

Bug fixed in commit 16c615056e914ed4342e6a307b40db80485acde2;
add a test to prevent it from happening again.

Fixes: https://todo.sr.ht/~jeremy/callisto/2
This commit is contained in:
Jeremy Baxter 2024-03-26 16:40:29 +13:00
parent 41829c3170
commit c8413899e3

View file

@ -195,6 +195,14 @@ fs.remove("%s")]]):format(
local sig = "SIGKILL"
assert(math.type(process.signum(sig)) == "integer")
-- https://todo.sr.ht/~jeremy/callisto/2
local ok, err = pcall(function ()
process.signum("SIGHELLO")
end)
assert(not ok)
assert(err:find("no such signal$"))
return 'process.signum("' .. sig .. '")'
end,
send = function ()