Skip to content

Commit

Permalink
Make sure all specified infoviews were actually checked in `infoview_…
Browse files Browse the repository at this point in the history
…check`.
  • Loading branch information
rish987 committed Jul 26, 2021
1 parent 9c6eac8 commit 05fcb4d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lua/tests/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ local function infoview_check(list)
elseif this_info.prev_check == "closed_kept" then
check = "closed_kept"
end
else
this_info.checked = true
end

if check == "opened" then
Expand All @@ -305,6 +307,13 @@ local function infoview_check(list)
this_info.prev_check = check
end

-- make sure all specified infoviews were hit
for id, check in pairs(list) do
assert.is_truthy(infoview._by_id[id].checked)
assert.are_equal(check, infoview._by_id[id].prev_check)
infoview._by_id[id].checked = nil
end

assert.update_wins(opened_wins, closed_wins)

return true
Expand Down

0 comments on commit 05fcb4d

Please sign in to comment.