File: test-client-shape.lua

package info (click to toggle)
awesome 4.3-8.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,468 kB
  • sloc: ansic: 14,508; sh: 526; makefile: 46
file content (34 lines) | stat: -rw-r--r-- 1,079 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
-- Test that client shapes work

local runner = require("_runner")
local spawn = require("awful.spawn")
local surface = require("gears.surface")

runner.run_steps{
    function(count)
        if count == 1 then
            local a = spawn("xeyes")
            assert(type(a) == "number", a)
        end
        if #client.get() == 1 then
            return true
        end
    end,

    function()
        -- Here would be the right place to actually test anything.
        -- However, this test just exists to stabilise code coverage (without
        -- it, it would always fluctuate). Thus, this is not really a test...
        local c = client.get()[1]
        assert(c.name == "xeyes", c.name)
        assert(surface.load_silently(c.client_shape_bounding, false))
        assert(surface.load_silently(c.shape_bounding, false))

        assert(not surface.load_silently(c.client_shape_clip, false))
        assert(not surface.load_silently(c.shape_clip, false))

        return true
    end
}

-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80