add another failing unit test for 'dk' motion

This commit is contained in:
2025-09-25 10:02:16 +01:00
parent 1921f87191
commit 594367d6d8
2 changed files with 33 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
hello
world
trello
brillo

View File

@@ -730,6 +730,38 @@ struct
Expect.isTrue
(expectedString = actualString andalso expectedIdx = cursorIdx)
end)
, test
"deletes just newline and line above when cursor is on third line"
(fn _ =>
let
(* arrange *)
val originalString = "hello\n\nagain\n"
val originalString =
"hello\n\
\world\n\
\\n\
\trello\n\
\brillo\n"
val originalIdx = 12
val app = TestUtils.init originalString
val app = AppWith.idx (app, originalIdx)
(* act *)
val {buffer, cursorIdx, ...} = TestUtils.updateMany (app, "dk")
(* assert *)
val expectedString =
"hello\n\
\trello\n\
\brillo\n"
val actualString = LineGap.toString buffer
val expectedIdx = 6
in
Expect.isTrue
(expectedString = actualString andalso expectedIdx = cursorIdx)
end)
]
val tests = [dhDelete, dlDelete, djDelete, ddDelete, dkDelete]