diff options
Diffstat (limited to 'test/functional/ui/screen.lua')
| -rw-r--r-- | test/functional/ui/screen.lua | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index a11fab18a2..d7af2a4fce 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -105,7 +105,7 @@ -- To generate a text-only test without highlight checks, -- use `screen:snapshot_util({},true)` -local helpers = require('test.functional.helpers') +local helpers = require('test.functional.helpers')(nil) local request, run = helpers.request, helpers.run local dedent = helpers.dedent @@ -290,6 +290,10 @@ If everything else fails, use Screen:redraw_debug to help investigate what is end end +function Screen:sleep(ms) + pcall(function() self:wait(function() return "error" end, ms) end) +end + function Screen:_redraw(updates) for _, update in ipairs(updates) do -- print('--') @@ -425,6 +429,10 @@ function Screen:_handle_update_bg(bg) self._bg = bg end +function Screen:_handle_update_sp(sp) + self._sp = sp +end + function Screen:_handle_suspend() self.suspended = true end @@ -497,7 +505,7 @@ end function Screen:snapshot_util(attrs, ignore) -- util to generate screen test - pcall(function() self:wait(function() return "error" end, 250) end) + self:sleep(250) self:print_snapshot(attrs, ignore) end @@ -573,7 +581,7 @@ function Screen:_pprint_attrs(attrs) local items = {} for f, v in pairs(attrs) do local desc = tostring(v) - if f == "foreground" or f == "background" then + if f == "foreground" or f == "background" or f == "special" then if Screen.colornames[v] ~= nil then desc = "Screen.colors."..Screen.colornames[v] end @@ -614,7 +622,8 @@ function Screen:_equal_attrs(a, b) a.underline == b.underline and a.undercurl == b.undercurl and a.italic == b.italic and a.reverse == b.reverse and a.foreground == b.foreground and - a.background == b.background + a.background == b.background and + a.special == b.special end function Screen:_attr_index(attrs, attr) |