add failing test for 'dk' motion

This commit is contained in:
2025-09-25 09:30:07 +01:00
parent de8f5b7761
commit 75b4f11822

View File

@@ -701,6 +701,30 @@ struct
val expectedString = "\n"
val actualString = LineGap.toString buffer
val expectedIdx = 0
in
Expect.isTrue
(expectedString = actualString andalso expectedIdx = cursorIdx)
end)
, test
"deletes newline and preceding line when cursor is second line \
\and second line contains only a newline"
(fn _ =>
let
(* arrange *)
val originalString = "hello\n\nagain\n"
val originalIdx = 6
val app = TestUtils.init originalString
val app = AppWith.idx (app, originalIdx)
(* act *)
val {buffer, cursorIdx, ...} = TestUtils.updateMany (app, "dk")
(* assert *)
val expectedString = "again\n"
val actualString = LineGap.toString buffer
val expectedIdx = 0
in
Expect.isTrue