add failing test for 'dj' motion, and progress reimplementing 'MakeNormalDelete.deleteLine'

This commit is contained in:
2025-09-25 06:11:36 +01:00
parent d25a06a9ed
commit b73117d075
2 changed files with 27 additions and 2 deletions

View File

@@ -436,6 +436,28 @@ struct
in
Expect.isTrue (stringIsExpected andalso cursorIdxIsExpected)
end)
, test "deletes two lines when cursor is on a newline" (fn _ =>
let
(* arrange *)
val originalString = "\nhello\nworld\ntrello\brillo\n"
val originalIdx = 0
val app = TestUtils.init originalString
val app = AppWith.idx (app, originalIdx)
(* act *)
val {cursorIdx, buffer, ...} = TestUtils.updateMany (app, "dj")
(* assert *)
val expectedString = "world\ntrello\nbrillo\n"
val actualString = LineGap.toString buffer
val stringIsExpected = expectedString = actualString
val expectedCursorIdx = 0
val cursorIdxIsExpected = expectedCursorIdx = cursorIdx
in
Expect.isTrue (stringIsExpected andalso cursorIdxIsExpected)
end)
]
val tests = [dhDelete, dlDelete, djDelete]