tests: Test `awful.placement.maximize`

This commit is contained in:
Emmanuel Lepage Vallee 2016-03-28 02:02:27 -04:00
parent 59b24cbd35
commit 7ab83afbbc
2 changed files with 18 additions and 6 deletions

View File

@ -646,12 +646,6 @@ end
--- Maximize a drawable horizontally, vertically or both. --- Maximize a drawable horizontally, vertically or both.
-- Valid args: -- Valid args:
-- --
-- * *margins*: A margin value or table
-- * *honor_workarea*:
-- * *honor_padding*:
-- * *tag*: Use a tag geometry, this honor the workarea, padding and gaps
-- * *parent*: A parent drawable to use a base geometry
-- * *bounding_rect*: A bounding rectangle
-- * *axis*:The axis (vertical or horizontal). If none is -- * *axis*:The axis (vertical or horizontal). If none is
-- specified, then the drawable will be maximized on both axis. -- specified, then the drawable will be maximized on both axis.
-- --

View File

@ -0,0 +1,18 @@
screen[1]._resize {width = 128, height = 96} --DOC_HIDE
screen._add_screen {x = 140, y = 0, width = 128, height = 96} --DOC_HIDE
screen._add_screen {x = 280, y = 0, width = 128, height = 96} --DOC_HIDE
local placement = require("awful.placement") --DOC_HIDE
for k, pos in ipairs{ --DOC_HIDE
"", "vertical", "horizontal" --DOC_HIDE
} do --DOC_HIDE
local c1 = client.gen_fake {--DOC_HIDE
x = screen[k].geometry.x+40, --DOC_HIDE
y = screen[k].geometry.y+40, width=75, height=50, screen=screen[k]} --DOC_HIDE
placement.maximize(c1, {axis = pos ~= "" and pos or nil}) --DOC_HIDE
if k == 1 then --DOC_HIDE
assert(c1.width+2*c1.border_width == screen[1].geometry.width and --DOC_HIDE
c1.height+2*c1.border_width == screen[1].geometry.height) --DOC_HIDE
end --DOC_HIDE
end --DOC_HIDE