add another failing unit test for 'dk' motion
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user