From 07d0bcb7138422a1cf112004253c852e02d4e684 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 7 May 2017 18:00:22 +0200 Subject: [PATCH] Stabilize awful.tooltip code coverage (#1773) For a while now we had our code coverage tools tell us that the coverage for one line of code fluctuated. Sometimes it was being executed and other times it was not. This is useless noise. I think what is happening here is that the coverage depends on the order of iteration over a table. Either the tooltip that is being created was first made visible and then it text changed, or things happened in the opposite order. Fix this by doing this by explicitly changing the tooltip's text while it is surely visible. Signed-off-by: Uli Schlachter --- tests/test-tooltip.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test-tooltip.lua b/tests/test-tooltip.lua index 03c9ce1ee..d545ec56d 100644 --- a/tests/test-tooltip.lua +++ b/tests/test-tooltip.lua @@ -26,7 +26,9 @@ place.centered(mouse) local tt = nil table.insert(steps, function() - tt = tooltip {text = "A long tooltip", visible = true} + tt = tooltip {text = "short", visible = true} + -- This tests changing the text while the tooltip is visible + tt:set_text("A long tooltip") return true end)