add another test for 'd^' motion, that we don't delete anything when cursor is on a newline (this one passes but it is an important case to test)

This commit is contained in:
2025-10-16 13:22:34 +01:00
parent 2667e58a26
commit a28e099b6f

View File

@@ -3229,6 +3229,27 @@ struct
(actualString = expectedString
andalso cursorIdx = expectedCursorIdx)
end)
, test
"does not delete from buffer or move cursor when cursor is on newline"
(fn _ =>
let
(* arrange *)
val originalString = "hello\n\nworld\n"
val app = TestUtils.init originalString
val app = AppWith.idx (app, 6)
(* act *)
val {buffer, cursorIdx, ...} = TestUtils.updateMany (app, "d^")
(* assert *)
val actualString = LineGap.toString buffer
val expectedString = originalString
val expectedCursorIdx = 6
in
Expect.isTrue
(actualString = expectedString
andalso cursorIdx = expectedCursorIdx)
end)
]
val tests =