add another test for 'dge' motion

This commit is contained in:
2025-10-14 15:19:24 +01:00
parent 999a35cb8b
commit 78a5fdff58
2 changed files with 24 additions and 1 deletions

View File

@@ -2394,6 +2394,27 @@ struct
(actualString = expectedString
andalso cursorIdx = expectedCursorIdx)
end)
, test "deletes past newline when on first word after newline" (fn _ =>
let
(* arrange *)
val originalString = "hello\nworld\nagain\n"
val app = TestUtils.init originalString
val app = AppWith.idx (app, 6)
(* act *)
val {buffer, cursorIdx, ...} = TestUtils.updateMany (app, "dge")
(* assert *)
val expectedString = "hellorld\nagain\n"
val expectedCursor = 4
val actualString = LineGap.toString buffer
val stringIsExpected = expectedString = actualString
val cursorIsExpected = expectedCursor = cursorIdx
in
Expect.isTrue (stringIsExpected andalso cursorIsExpected)
end)
]
val tests =