Skip to content

Commit

Permalink
tests: more tolerance for sleep overshooting its time
Browse files Browse the repository at this point in the history
CI machines can take a while doing some other thing during a sleep.
  • Loading branch information
slime73 committed Dec 13, 2023
1 parent e6af895 commit a6ae0ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions testing/tests/timer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ love.test.timer.getTime = function(test)
local starttime = love.timer.getTime()
love.timer.sleep(0.1)
local endtime = love.timer.getTime() - starttime
test:assertRange(endtime, 0.05, 0.15, 'check 0.1s passes')
test:assertRange(endtime, 0.05, 1, 'check 0.1s passes')
end


-- love.timer.sleep
love.test.timer.sleep = function(test)
local starttime = love.timer.getTime()
love.timer.sleep(0.1)
test:assertRange(love.timer.getTime() - starttime, 0.05, 0.15, 'check 0.1s passes')
test:assertRange(love.timer.getTime() - starttime, 0.05, 1, 'check 0.1s passes')
end


Expand Down

0 comments on commit a6ae0ae

Please sign in to comment.