Check argument against negative sleep duration

This commit is contained in:
2025-06-28 19:59:37 +10:00
parent d5e85f2c30
commit 505364a661
2 changed files with 6 additions and 1 deletions

View File

@@ -111,6 +111,11 @@ describe("spawn", function()
end)
describe("sleep", function()
test("invalid arg", function()
assert(not pcall(task.sleep, "invalid"))
task.sleep(-1) -- negative sleep should just become 0ms
end)
test("sleep is asynchronous", function()
local value
spawn(function()