From 88add4ed6f3b1a7f7498a5ffa7e56131cd1326fa Mon Sep 17 00:00:00 2001 From: zwim <36999612+zwim@users.noreply.github.com> Date: Thu, 27 Oct 2022 21:14:25 +0200 Subject: [PATCH] [spec] _task_queue has to be sorted! (#9694) --- spec/unit/uimanager_spec.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/unit/uimanager_spec.lua b/spec/unit/uimanager_spec.lua index d4bd1a32c..d68cfbe68 100644 --- a/spec/unit/uimanager_spec.lua +++ b/spec/unit/uimanager_spec.lua @@ -188,16 +188,17 @@ describe("UIManager spec", function() end UIManager:quit() 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), - action = function() + action = function() -- this will be called, too run_count = run_count + 1 UIManager:unschedule(task_to_remove) end, 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() assert.are.same(2, run_count)