add another test for 'dw' motion

This commit is contained in:
2025-09-26 07:58:23 +01:00
parent 88a1489a54
commit 5e1e66a977

View File

@@ -944,6 +944,30 @@ struct
in
Expect.isTrue (stringsAreExpected andalso cursorsAreExpected)
end)
, test
"deletes newline when there is a newline after current word \
\and there is another word following that newline"
(fn _ =>
let
(* arrange *)
val originalString = "hello\nworld\nagain\n"
val app = TestUtils.init originalString
val app = AppWith.idx (app, 1)
(* act *)
val {buffer, cursorIdx, ...} = TestUtils.updateMany (app, "dw")
(* assert *)
val expectedString = "hworld\nagain\n"
val expectedCursor = 1
val actualString = LineGap.toString buffer
val stringIsExpected = expectedString = actualString
val cursorIsExpected = expectedCursor = cursorIdx
in
Expect.isTrue (stringIsExpected andalso cursorIsExpected)
end)
]
val tests = [dhDelete, dlDelete, djDelete, ddDelete, dkDelete, dwDelete]