tests: Add a `new_tag` rule multi-screen test

This commit is contained in:
Emmanuel Lepage Vallee 2016-11-27 04:52:47 -05:00
parent 6f7019b2d0
commit 28486527e7
1 changed files with 30 additions and 0 deletions

View File

@ -209,6 +209,36 @@ table.insert(multi_screen_steps, function()
return true
end)
-- Test the `new_tag` rule
table.insert(multi_screen_steps, function()
for _, c in ipairs(client.get()) do
c:kill()
end
for i=1, screen.count() do
local s = screen[i]
test_client("screen"..i, nil, {
new_tag = {
name = "NEW_AT_"..i,
screen = s,
}
})
end
return true
end)
table.insert(multi_screen_steps, function()
if #client.get() ~= screen.count() then return end
for _, c in ipairs(client.get()) do
assert(#c:tags() == 1)
assert(c.first_tag.name == "NEW_AT_"..c.screen.index)
end
return true
end)
require("_multi_screen")(steps, multi_screen_steps)
require("_runner").run_steps(steps)