From 05fcb4dd3ed468c514ae50dca958493b869f0b9f Mon Sep 17 00:00:00 2001 From: Rishikesh Vaishnav Date: Mon, 26 Jul 2021 11:53:55 -0700 Subject: [PATCH] Make sure all specified infoviews were actually checked in `infoview_check`. --- lua/tests/helpers.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lua/tests/helpers.lua b/lua/tests/helpers.lua index 3d078f59..b3c49710 100644 --- a/lua/tests/helpers.lua +++ b/lua/tests/helpers.lua @@ -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 @@ -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