From 61d8d74421c00358915b1b5c7eaaad265d7601dc Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 26 Sep 2016 21:47:08 +0200 Subject: [PATCH] Fix test-tooltip.lua: Run the event loop This test changes the mouse cursor's position and afterwards has an assert that checks something on the tooltip. This really looks a lot like it expects the mouse cursor's position to be already updated and its enter and leave events to be handled. However, this is now how things actually work. Fix this by moving the assert into its own step, so that in between the normal main loop runs. Signed-off-by: Uli Schlachter --- tests/test-tooltip.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test-tooltip.lua b/tests/test-tooltip.lua index ab25a565..03c9ce1e 100644 --- a/tests/test-tooltip.lua +++ b/tests/test-tooltip.lua @@ -93,8 +93,12 @@ table.insert(steps, function() x = w.x + w.width - 20 - 12.5, y = w.y + 125 + 12.5, } + return true +end) - assert(tt.current_position == "top") +-- Test that the above move had the intended effect +table.insert(steps, function() + assert(tt.current_position == "top", tt.current_position) return true end)