[spec] _task_queue has to be sorted! (#9694)

reviewable/pr9697/r1
zwim 2 years ago committed by GitHub
parent d37803a8e7
commit 88add4ed6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -188,16 +188,17 @@ describe("UIManager spec", function()
end end
UIManager:quit() UIManager:quit()
UIManager._task_queue = { UIManager._task_queue = {
{ time = now - time.us(5), action = task_to_remove, args = {} }, { time = now - time.s(15), action = task_to_remove, args = {} }, -- this will be called
{ {
time = now - time.s(10), time = now - time.s(10),
action = function() action = function() -- this will be called, too
run_count = run_count + 1 run_count = run_count + 1
UIManager:unschedule(task_to_remove) UIManager:unschedule(task_to_remove)
end, end,
args = {}, args = {},
}, },
{ time = now, action = task_to_remove, args = {} }, { time = now - time.us(5), action = task_to_remove, args = {} }, -- this will be removed
{ time = now, action = task_to_remove, args = {} }, -- this will be removed
} }
UIManager:_checkTasks() UIManager:_checkTasks()
assert.are.same(2, run_count) assert.are.same(2, run_count)

Loading…
Cancel
Save