From c8413899e3d7c2f71e86c90d15dc8d9b2ca8c855 Mon Sep 17 00:00:00 2001 From: Jeremy Baxter Date: Tue, 26 Mar 2024 16:40:29 +1300 Subject: [PATCH] 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 --- test.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test.lua b/test.lua index 8ce6681..8bc2208 100644 --- a/test.lua +++ b/test.lua @@ -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 ()