Skip to content

Commit

Permalink
Add one more regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
daxian-dbw committed Sep 22, 2021
1 parent b888555 commit 1f8dfe4
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/BasicEditingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,36 @@ public void DeleteCharOrExit()
Test("exit", Keys("foo", _.Home, Enumerable.Repeat(_.Ctrl_d, 4), InputAcceptedNow));
}

[SkippableFact]
public void SelectAndDelete()
{
TestSetup(KeyMode.Cmd);

Test("abcde", Keys(
"abcde",
CheckThat(() => AssertCursorLeftIs(5)),
_.Shift_LeftArrow, _.Shift_LeftArrow, _.Shift_LeftArrow,
_.Backspace,
CheckThat(() => AssertLineIs("ab")),
CheckThat(() => AssertCursorLeftIs(2)),
_.Ctrl_z,
CheckThat(() => AssertLineIs("abcde")),
CheckThat(() => AssertCursorLeftIs(5))));

Test("abcde", Keys(
"abcde", _.Home,
CheckThat(() => AssertCursorLeftIs(0)),
_.RightArrow, _.RightArrow,
CheckThat(() => AssertCursorLeftIs(2)),
_.Shift_RightArrow, _.Shift_RightArrow,
_.Delete,
CheckThat(() => AssertLineIs("abe")),
CheckThat(() => AssertCursorLeftIs(2)),
_.Ctrl_z,
CheckThat(() => AssertLineIs("abcde")),
CheckThat(() => AssertCursorLeftIs(4))));
}

[SkippableFact]
public void SwapCharacters()
{
Expand Down

0 comments on commit 1f8dfe4

Please sign in to comment.