ui: use Window type in win_pos consistently with win_float_pos

Also check invalid positional arguments to screen:expect()
This commit is contained in:
Björn Linse
2019-08-17 20:52:08 +02:00
parent e2ccf47b5e
commit 3397b8c51a
3 changed files with 19 additions and 18 deletions

View File

@@ -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,