Check argument against negative sleep duration
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user