diff --git a/tests/test-struts.lua b/tests/test-struts.lua index af0f5d4e..f388ae99 100644 --- a/tests/test-struts.lua +++ b/tests/test-struts.lua @@ -78,40 +78,40 @@ table.insert(steps, function() end) table.insert(steps, function() -assert(parent:geometry().width == 500) -assert(parent:geometry().height == 500) + assert(parent:geometry().width == 500) + assert(parent:geometry().height == 500) -assert(parent:geometry().y == small:geometry().y) -assert(parent:geometry().x == small:geometry().x) -assert(parent:geometry().width == small:geometry().width ) -assert(small:geometry().height == 24) + assert(parent:geometry().y == small:geometry().y) + assert(parent:geometry().x == small:geometry().x) + assert(parent:geometry().width == small:geometry().width ) + assert(small:geometry().height == 24) --- Now, move the parent and see of the attached one is correctly updated -placement.stretch_left(parent) + -- Now, move the parent and see of the attached one is correctly updated + placement.stretch_left(parent) -return true + return true end) table.insert(steps, function() -assert(parent:geometry().y == small:geometry().y) -assert(parent:geometry().x == small:geometry().x) -assert(parent:geometry().width == small:geometry().width ) -assert(small:geometry().height == 24) + assert(parent:geometry().y == small:geometry().y) + assert(parent:geometry().x == small:geometry().x) + assert(parent:geometry().width == small:geometry().width ) + assert(small:geometry().height == 24) --- Do the same, but with placement compositing -small = wibox { - bg = "#ff0000", - height = 50, - width = 50, - ontop = true, - visible = true, -} + -- Do the same, but with placement compositing + small = wibox { + bg = "#ff0000", + height = 50, + width = 50, + ontop = true, + visible = true, + } -local p = placement.bottom_right + placement.scale + local p = placement.bottom_right + placement.scale -p(small, {parent=parent, attach=true, direction="left", to_percent=0.5}) + p(small, {parent=parent, attach=true, direction="left", to_percent=0.5}) -return true + return true end) local function check_ratio() @@ -153,27 +153,27 @@ table.insert(steps, function() end) table.insert(steps, function() -local wa = screen.primary.workarea -local sgeo = screen.primary.geometry -local wgeo = twibar:geometry() + local wa = screen.primary.workarea + local sgeo = screen.primary.geometry + local wgeo = twibar:geometry() -assert(wa.width == sgeo.width ) -assert(wa.x == sgeo.x ) -assert(wa.y == sgeo.y + wgeo.height ) --- assert(wa.height == sgeo.height - wgeo.height) --- assert(wgeo.height == sgeo.height - wa.height ) + assert(wa.width == sgeo.width ) + assert(wa.x == sgeo.x ) + assert(wa.y == sgeo.y + wgeo.height ) + -- assert(wa.height == sgeo.height - wgeo.height) + -- assert(wgeo.height == sgeo.height - wa.height ) -assert(parent.y == wa.y ) -assert(parent.x == wa.x ) -assert(parent.width == wa.width ) -assert(parent.height == wa.height ) + assert(parent.y == wa.y ) + assert(parent.x == wa.x ) + assert(parent.width == wa.width ) + assert(parent.height == wa.height ) --- Add more wibars -bwibar = wibar {position = "bottom", bg = "#00ff00"} -lwibar = wibar {position = "left" , bg = "#0000ff"} -rwibar = wibar {position = "right" , bg = "#ff00ff"} + -- Add more wibars + bwibar = wibar {position = "bottom", bg = "#00ff00"} + lwibar = wibar {position = "left" , bg = "#0000ff"} + rwibar = wibar {position = "right" , bg = "#ff00ff"} -return true + return true end) -- Make sure the maximized client has the right size and position @@ -243,54 +243,54 @@ table.insert(steps, function() end) table.insert(steps, function() -check_maximize() + check_maximize() --- There should be a detach callback -assert(lwibar.detach_callback) + -- There should be a detach callback + assert(lwibar.detach_callback) --- Begin to move wibars around -lwibar.position = "top" -assert(lwibar.position == "top") -assert(lwibar.y == twibar.height) + -- Begin to move wibars around + lwibar.position = "top" + assert(lwibar.position == "top") + assert(lwibar.y == twibar.height) -return true + return true end) table.insert(steps, function() -check_maximize() + check_maximize() -bwibar.position = "right" -bwibar.ontop = true -rwibar.ontop = true -assert(bwibar.position == "right") + bwibar.position = "right" + bwibar.ontop = true + rwibar.ontop = true + assert(bwibar.position == "right") -return true + return true end) table.insert(steps, function() -check_maximize() + check_maximize() -rwibar.position = "top" + rwibar.position = "top" -return true + return true end) table.insert(steps, function() -check_maximize() + check_maximize() -bwibar.position = "top" + bwibar.position = "top" -return true + return true end) table.insert(steps, function() -check_maximize() + check_maximize() -for _, w in ipairs {twibar, lwibar, rwibar, bwibar} do - w.position = "right" -end + for _, w in ipairs {twibar, lwibar, rwibar, bwibar} do + w.position = "right" + end -return true + return true end) -- Test visibility @@ -304,17 +304,17 @@ table.insert(steps, function() end) table.insert(steps, function() -check_maximize() + check_maximize() -twibar.visible = true + twibar.visible = true -return true + return true end) table.insert(steps, function() -check_maximize() + check_maximize() -return true + return true end)