Skip to content

Commit 48bf1d5

Browse files
committed
Fix ViGotoBrace tests
These tests need to be cleared with `ddi` and then asserted to be empty. It's the same fix for the other tests whose input contains unmatched braces. Copilot's plausible explanation is that the unmatched braces cause the input to be flagged by PowerShell's parser as incomplete, so `AcceptLineImpl` instead waits for more input, causing the exception.
1 parent 277b071 commit 48bf1d5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/MovementTest.VI.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,13 +460,14 @@ public void ViGotoBrace()
460460
{
461461
// closing paren with backward match
462462
string input1 = $"0{opening}2{opening}4foo{closing}";
463-
Test(input1, Keys(
463+
Test("", Keys(
464464
input1,
465465
CheckThat(() => AssertCursorLeftIs(9)),
466466
_.Escape, CheckThat(() => AssertCursorLeftIs(8)),
467467
"0ff", CheckThat(() => AssertCursorLeftIs(5)),
468468
_.Percent, CheckThat(() => AssertCursorLeftIs(3)),
469-
_.Percent, CheckThat(() => AssertCursorLeftIs(8))
469+
_.Percent, CheckThat(() => AssertCursorLeftIs(8)),
470+
"ddi"
470471
));
471472

472473
// closing paren without backward match
@@ -492,13 +493,14 @@ public void ViGotoBrace()
492493
));
493494
// opening paren without forward match
494495
string input4 = $"0)2]4foo{opening}(";
495-
Test(input4, Keys(
496+
TestMustDing("", Keys(
496497
input4,
497498
CheckThat(() => AssertCursorLeftIs(10)),
498499
_.Escape, CheckThat(() => AssertCursorLeftIs(9)),
499500
"0ff", CheckThat(() => AssertCursorLeftIs(5)),
500501
_.Percent, CheckThat(() => AssertCursorLeftIs(5)), // stay still
501-
_.Percent, CheckThat(() => AssertCursorLeftIs(5))
502+
_.Percent, CheckThat(() => AssertCursorLeftIs(5)),
503+
"ddi"
502504
));
503505
}
504506

0 commit comments

Comments
 (0)