From 144b9ef6976388c9f6d860f244f016f529083c43 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 29 Oct 2016 14:57:58 +0200 Subject: [PATCH] Add a kind of test for wibox shape support Signed-off-by: Uli Schlachter --- tests/test-wibox-shape.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/test-wibox-shape.lua diff --git a/tests/test-wibox-shape.lua b/tests/test-wibox-shape.lua new file mode 100644 index 00000000..62166f10 --- /dev/null +++ b/tests/test-wibox-shape.lua @@ -0,0 +1,31 @@ +-- A quick-and-dirty test of wibox shapes ("Does it error out?") + +local runner = require("_runner") +local wibox = require("wibox") +local shape = require("gears.shape") + +local was_drawn +local widget = wibox.widget.base.make_widget() +function widget.draw() + was_drawn = true +end + +local wb = wibox { + shape = shape.powerline, + widget = widget, + border_width = 42, +} +wb:geometry(screen[1].geometry) +wb.visible = true + +runner.run_steps({ + function() + assert(wb.shape == shape.powerline) + assert(wb.shape_bounding) -- This is a memory leak! Don't copy! + if was_drawn then + return true + end + end +}) + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80