From 4475df82644479563cb425a9a1587a9478031fd0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 14 Aug 2020 12:33:40 +0200 Subject: [PATCH] Add unit tests for wxGrid::Deselect{Row,Col}() These functions got broken by the changes of cdf3187fe5 (Improve rows, columns and cells deselection in wxGrid, 2020-03-26), but this went unnoticed because they were not covered by the unit tests, so add the tests for them to prevent this from happening again in the future. --- tests/controls/gridtest.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/controls/gridtest.cpp b/tests/controls/gridtest.cpp index 9429a76ac8..8a862fb7ce 100644 --- a/tests/controls/gridtest.cpp +++ b/tests/controls/gridtest.cpp @@ -565,6 +565,13 @@ TEST_CASE_METHOD(GridTestCase, "Grid::Selection", "[grid]") CHECK(m_grid->IsInSelection(4, 0)); CHECK(m_grid->IsInSelection(4, 1)); CHECK(!m_grid->IsInSelection(3, 0)); + + m_grid->DeselectRow(4); + CHECK(!m_grid->IsInSelection(4, 0)); + CHECK(!m_grid->IsInSelection(4, 1)); + + m_grid->DeselectCol(1); + CHECK(!m_grid->IsInSelection(0, 1)); } TEST_CASE_METHOD(GridTestCase, "Grid::SelectionRange", "[grid]")