Skip to content

Commit

Permalink
TerminalCore: Get the tests working with Selection spans
Browse files Browse the repository at this point in the history
  • Loading branch information
DHowett committed Aug 3, 2024
1 parent ce14914 commit d62b9c9
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 199 deletions.
11 changes: 0 additions & 11 deletions src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ namespace ControlUnitTests
true);
Log::Comment(L"Verify that there's one selection");
VERIFY_IS_TRUE(core->HasSelection());
VERIFY_ARE_EQUAL(1u, core->_terminal->GetSelectionRects().size());

Log::Comment(L"Drag the mouse down a whole row");
const til::point terminalPosition2{ 1, 1 };
Expand All @@ -349,7 +348,6 @@ namespace ControlUnitTests
true);
Log::Comment(L"Verify that there's now two selections (one on each row)");
VERIFY_IS_TRUE(core->HasSelection());
VERIFY_ARE_EQUAL(2u, core->_terminal->GetSelectionRects().size());

Log::Comment(L"Release the mouse");
interactivity->PointerReleased(noMouseDown,
Expand All @@ -358,7 +356,6 @@ namespace ControlUnitTests
cursorPosition2.to_core_point());
Log::Comment(L"Verify that there's still two selections");
VERIFY_IS_TRUE(core->HasSelection());
VERIFY_ARE_EQUAL(2u, core->_terminal->GetSelectionRects().size());

Log::Comment(L"click outside the current selection");
const til::point terminalPosition3{ 2, 2 };
Expand All @@ -370,7 +367,6 @@ namespace ControlUnitTests
cursorPosition3.to_core_point());
Log::Comment(L"Verify that there's now no selection");
VERIFY_IS_FALSE(core->HasSelection());
VERIFY_ARE_EQUAL(0u, core->_terminal->GetSelectionRects().size());

Log::Comment(L"Drag the mouse");
const til::point terminalPosition4{ 3, 2 };
Expand All @@ -383,7 +379,6 @@ namespace ControlUnitTests
true);
Log::Comment(L"Verify that there's now one selection");
VERIFY_IS_TRUE(core->HasSelection());
VERIFY_ARE_EQUAL(1u, core->_terminal->GetSelectionRects().size());
}

void ControlInteractivityTests::ScrollWithSelection()
Expand Down Expand Up @@ -438,7 +433,6 @@ namespace ControlUnitTests
true);
Log::Comment(L"Verify that there's one selection");
VERIFY_IS_TRUE(core->HasSelection());
VERIFY_ARE_EQUAL(1u, core->_terminal->GetSelectionRects().size());

Log::Comment(L"Verify the location of the selection");
// The viewport is on row 21, so the selection will be on:
Expand Down Expand Up @@ -586,7 +580,6 @@ namespace ControlUnitTests
true);
Log::Comment(L"Verify that there's one selection");
VERIFY_IS_TRUE(core->HasSelection());
VERIFY_ARE_EQUAL(1u, core->_terminal->GetSelectionRects().size());

Log::Comment(L"Verify that it started on the first cell we clicked on, not the one we dragged to");
til::point expectedAnchor{ 0, 0 };
Expand Down Expand Up @@ -631,7 +624,6 @@ namespace ControlUnitTests
true);
Log::Comment(L"Verify that there's one selection");
VERIFY_IS_TRUE(core->HasSelection());
VERIFY_ARE_EQUAL(1u, core->_terminal->GetSelectionRects().size());

Log::Comment(L"Verify that it started on the first cell we clicked on, not the one we dragged to");
til::point expectedAnchor{ 0, 0 };
Expand Down Expand Up @@ -801,7 +793,6 @@ namespace ControlUnitTests
true);
Log::Comment(L"Verify that there's one selection");
VERIFY_IS_TRUE(core->HasSelection());
VERIFY_ARE_EQUAL(1u, core->_terminal->GetSelectionRects().size());

Log::Comment(L"Verify the location of the selection");
// The viewport is on row (historySize + 5), so the selection will be on:
Expand Down Expand Up @@ -860,7 +851,6 @@ namespace ControlUnitTests
cursorPosition0.to_core_point(),
true);
VERIFY_IS_TRUE(core->HasSelection());
VERIFY_ARE_EQUAL(1u, core->_terminal->GetSelectionRects().size());
{
const auto anchor{ core->_terminal->GetSelectionAnchor() };
const auto end{ core->_terminal->GetSelectionEnd() };
Expand All @@ -885,7 +875,6 @@ namespace ControlUnitTests
cursorPosition1.to_core_point(),
true);
VERIFY_IS_TRUE(core->HasSelection());
VERIFY_ARE_EQUAL(1u, core->_terminal->GetSelectionRects().size());
{
const auto anchor{ core->_terminal->GetSelectionAnchor() };
const auto end{ core->_terminal->GetSelectionEnd() };
Expand Down
Loading

0 comments on commit d62b9c9

Please sign in to comment.