From d73959ce9b5cdaa41de75b66dad0f13c782a67c1 Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Tue, 14 Oct 2025 12:21:23 +0100 Subject: [PATCH] find failing test case for 'dge' motion (deletion works as expected, but cursor is at wrong place) --- test/normal-delete.sml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/normal-delete.sml b/test/normal-delete.sml index 264ede3..dd8a7eb 100644 --- a/test/normal-delete.sml +++ b/test/normal-delete.sml @@ -2372,6 +2372,28 @@ struct in Expect.isTrue (stringsAreExpected andalso cursorsAreExpected) end) + , test + "deletes all characters in word \ + \when on last character of last word in buffer" + (fn _ => + let + (* arrange *) + val originalString = "hello world\n" + val app = TestUtils.init originalString + val app = AppWith.idx (app, String.size originalString - 2) + + (* act *) + val {buffer, cursorIdx, ...} = TestUtils.updateMany (app, "dge") + + (* assert *) + val actualString = LineGap.toString buffer + val expectedString = "hell world\n" + val expectedCursorIdx = String.size expectedString - 2 + in + Expect.isTrue + (actualString = expectedString + andalso cursorIdx = expectedCursorIdx) + end) ] val tests =