From 3397b8c51a6d65a24bb2d9860e27fb3d8770dba6 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sat, 17 Aug 2019 20:52:08 +0200 Subject: ui: use Window type in win_pos consistently with win_float_pos Also check invalid positional arguments to screen:expect() --- test/functional/ui/screen.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/functional/ui/screen.lua') diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index 81a15cada2..d8ad9c9879 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -316,9 +316,10 @@ local ext_keys = { -- cmdline_block: Expected ext_cmdline block (for function definitions) -- wildmenu_items: Expected items for ext_wildmenu -- wildmenu_pos: Expected position for ext_wildmenu -function Screen:expect(expected, attr_ids, attr_ignore) +function Screen:expect(expected, attr_ids, attr_ignore, ...) local grid, condition = nil, nil local expected_rows = {} + assert(next({...}) == nil, "invalid args to expect()") if type(expected) == "table" then assert(not (attr_ids ~= nil or attr_ignore ~= nil)) local is_key = {grid=true, attr_ids=true, attr_ignore=true, condition=true, -- cgit From 6b2d67eb59e915242e33ed0e9923cd7a80213360 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sat, 17 Aug 2019 21:46:11 +0200 Subject: test/ui: properly test win_hide by explicitly marking hidden grids --- test/functional/ui/screen.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/functional/ui/screen.lua') diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index d8ad9c9879..517e8590a2 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -1212,7 +1212,11 @@ function Screen:render(headers, attr_state, preview) local rv = {} for igrid,grid in pairs(self._grids) do if headers then - table.insert(rv, "## grid "..igrid) + local suffix = "" + if igrid > 1 and self.win_position[igrid] == nil and self.float_pos[igrid] == nil then + suffix = " (hidden)" + end + table.insert(rv, "## grid "..igrid..suffix) end for i = 1, grid.height do local cursor = self._cursor.grid == igrid and self._cursor.row == i -- cgit From 628f8f3dfdbc734096b04c3040c1f4d2cea873c4 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sat, 17 Aug 2019 22:07:22 +0200 Subject: ui: transmit "blend=" property of highlight attributes --- test/functional/ui/screen.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/ui/screen.lua') diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index 517e8590a2..df0fce4199 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -1496,7 +1496,7 @@ 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 and - a.special == b.special + a.special == b.special and a.blend == b.blend end function Screen:_equal_info(a, b) -- cgit