test/ui: add redraw debug util

This commit is contained in:
Björn Linse authored and Thiago de Arruda committed 2015-04-03 09:05:04 -03:00
1 parent a5561fe610
commit e5c4c4bca2
1 file changed
+18
+18
View File
@@ -456,6 +456,24 @@ end
function Screen:snapshot_util(attrs, ignore)
-- util to generate screen test
pcall(function() self:wait(function() return "error" end, 250) end)
self:print_snapshot(attrs, ignore)
end
function Screen:redraw_debug(attrs, ignore)
self:print_snapshot(attrs, ignore)
local function notification_cb(method, args)
assert(method == 'redraw')
for _, update in ipairs(args) do
print(require('inspect')(update))
end
self:_redraw(args)
self:print_snapshot(attrs, ignore)
return true
end
run(nil, notification_cb, nil, 250)
end
function Screen:print_snapshot(attrs, ignore)
if ignore == nil then
ignore = self._default_attr_ignore
end