awesome/tests/test-tag-gap-single-client.lua
Uli Schlachter d07fc822a1 Fix awful.tag.object.get_gap_single_client (#1190)
The usual "a or b"-trick to simulate C's ?:-operator does not work when
"false" is a valid value. Fix the code to handle this correctly and add
a short unit test which would have caught this problem.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-26 01:43:45 +02:00

20 lines
641 B
Lua

local beautiful = require("beautiful")
local runner = require("_runner")
local t = screen.primary.tags[1]
assert(t)
-- The default should be true
assert(t.gap_single_client == true, tostring(t.gap_single_client))
-- Beautiful should override the default
beautiful.gap_single_client = false
assert(t.gap_single_client == false, tostring(t.gap_single_client))
-- Tag-specific properties should override beautiful
t.gap_single_client = true
assert(t.gap_single_client == true, tostring(t.gap_single_client))
runner.run_steps({ function() return true end })
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80