From 2e6c911821617778a6a3114d46c78925c7bcf6c6 Mon Sep 17 00:00:00 2001 From: Ari Breitkreuz Date: Fri, 24 Apr 2020 14:48:17 +0200 Subject: [PATCH] Add test for menubar.match_empty --- tests/test-menubar.lua | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/tests/test-menubar.lua b/tests/test-menubar.lua index 0eb5d43e3..8e64418b3 100644 --- a/tests/test-menubar.lua +++ b/tests/test-menubar.lua @@ -37,22 +37,33 @@ do end end +local show_menubar_and_hide = function(count) + -- Just show the menubar and hide it. + -- TODO: Write a proper test. But for the mean time this is better than + -- nothing (and tells us when errors are thrown). + + if count == 1 then + menubar.show() + end + + -- Test that the async population of the menubar is done + if menubar_refreshed then + menubar.hide() + awesome.sync() + return true + end +end + runner.run_steps { function(count) - -- Just show the menubar and hide it. - -- TODO: Write a proper test. But for the mean time this is better than - -- nothing (and tells us when errors are thrown). + -- Show and hide with defaults + return show_menubar_and_hide(count) + end, - if count == 1 then - menubar.show() - end - - -- Test that the async population of the menubar is done - if menubar_refreshed then - menubar.hide() - awesome.sync() - return true - end + function(count) + -- Show and hide with match_empty set to false + menubar.match_empty = false + return show_menubar_and_hide(count) end, function()