test-awful-placement: Reindent after the previous change

Only whitespace changes and reformatting of comments.

Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
This commit is contained in:
Sergey Vlasov 2019-07-03 10:45:06 +03:00
parent 9e894d8fdd
commit 1c27f9d227
1 changed files with 96 additions and 95 deletions

View File

@ -78,110 +78,111 @@ end
-- Repeat testing 3 times. -- Repeat testing 3 times.
for _, _ in ipairs{1, 2, 3} do for _, _ in ipairs{1, 2, 3} do
-- The first 100x100 window should be placed at the top left corner. -- The first 100x100 window should be placed at the top left corner.
add_client { add_client {
geometry = function(wa) geometry = function(wa)
return { return {
width = 100, width = 100,
height = 100, height = 100,
expected_x = wa.x, expected_x = wa.x,
expected_y = wa.y expected_y = wa.y
} }
end end
} }
-- The second 100x100 window should be placed to the right of the first window. -- The second 100x100 window should be placed to the right of the first
-- Note that this assumption fails if the screen is in the portrait orientation -- window. Note that this assumption fails if the screen is in the portrait
-- (e.g., the test succeeds with a 600x703 screen and fails with 600x704). -- orientation (e.g., the test succeeds with a 600x703 screen and fails with
add_client { -- 600x704).
geometry = function(wa) add_client {
return { geometry = function(wa)
width = 100, return {
height = 100, width = 100,
expected_x = wa.x + 100 + 2*border_width, height = 100,
expected_y = wa.y expected_x = wa.x + 100 + 2*border_width,
} expected_y = wa.y
end }
} end
}
-- The wide window should be placed below the two 100x100 windows. -- The wide window should be placed below the two 100x100 windows.
add_client { add_client {
geometry = function(wa) geometry = function(wa)
return { return {
width = wa.width - 50, width = wa.width - 50,
height = 100, height = 100,
expected_x = wa.x, expected_x = wa.x,
expected_y = wa.y + tb_height + 2*border_width + 100 expected_y = wa.y + tb_height + 2*border_width + 100
} }
end end
} }
-- The first large window which does not completely fit in any free area should -- The first large window which does not completely fit in any free area
-- be placed at the bottom left corner (no_overlap should place it below the -- should be placed at the bottom left corner (no_overlap should place it
-- wide window, and then no_offscreen should shift it up so that it would be -- below the wide window, and then no_offscreen should shift it up so that
-- completely inside the workarea). -- it would be completely inside the workarea).
add_client { add_client {
geometry = function(wa) geometry = function(wa)
return { return {
width = wa.width - 10, width = wa.width - 10,
height = wa.height - 50, height = wa.height - 50,
expected_x = wa.x, expected_x = wa.x,
expected_y = wa.y + 50 - 2*border_width - tb_height expected_y = wa.y + 50 - 2*border_width - tb_height
} }
end end
} }
-- The second large window should be placed at the top right corner. -- The second large window should be placed at the top right corner.
add_client { add_client {
geometry = function(wa) geometry = function(wa)
return { return {
width = wa.width - 10, width = wa.width - 10,
height = wa.height - 50, height = wa.height - 50,
expected_x = wa.x + 10 - 2*border_width, expected_x = wa.x + 10 - 2*border_width,
expected_y = wa.y expected_y = wa.y
} }
end end
} }
-- The third large window should be placed at the bottom right corner. -- The third large window should be placed at the bottom right corner.
add_client { add_client {
geometry = function(wa) geometry = function(wa)
return { return {
width = wa.width - 10, width = wa.width - 10,
height = wa.height - 50, height = wa.height - 50,
expected_x = wa.x + 10 - 2*border_width, expected_x = wa.x + 10 - 2*border_width,
expected_y = wa.y + 50 - 2*border_width - tb_height expected_y = wa.y + 50 - 2*border_width - tb_height
} }
end end
} }
-- The fourth large window should be placed at the top left corner (the whole -- The fourth large window should be placed at the top left corner (the
-- workarea is occupied now). -- whole workarea is occupied now).
add_client { add_client {
geometry = function(wa) geometry = function(wa)
return { return {
width = wa.width - 50, width = wa.width - 50,
height = wa.height - 50, height = wa.height - 50,
expected_x = wa.x, expected_x = wa.x,
expected_y = wa.y expected_y = wa.y
} }
end end
} }
-- Kill test clients to prepare for the next iteration. -- Kill test clients to prepare for the next iteration.
table.insert(tests, function(count) table.insert(tests, function(count)
if count <= 1 then if count <= 1 then
for _, data in ipairs(client_data) do for _, data in ipairs(client_data) do
if data.c then if data.c then
data.c:kill() data.c:kill()
data.c = nil data.c = nil
end
end end
end end
end if #client.get() == 0 then
if #client.get() == 0 then return true
return true end
end end)
end)
end end