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 <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2017-05-07 18:00:22 +02:00 committed by Daniel Hahler
parent bcf70f3740
commit 07d0bcb713
1 changed files with 3 additions and 1 deletions

View File

@ -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)