add just one more 'word' test, extract steps to delete from search list into a reusable function (don't need to memorise the steps), and fix bug in cursor.sml where we were looking at tl without calculating correct strIdx

This commit is contained in:
2024-11-23 05:16:37 +00:00
parent 4a09a5716d
commit 0bfe549e04
3 changed files with 30 additions and 9 deletions

View File

@@ -730,6 +730,22 @@ val wMove = describe "move motion 'w'"
in
Expect.isTrue (cursorChr = #"7")
end)
, test "moves cursor to first alphanumeric char when in punctuation" (fn _ =>
let
(* arrange *)
val buffer = LineGap.fromString "!!! hello\n"
val app = AppType.init (buffer, 0, 0)
(* act *)
val (app1, _) = AppUpdate.update (app, CHAR_EVENT #"w")
(* assert *)
val startsAtExc = getChr app = #"!"
val movedToH = getChr app1 = #"h"
in
Expect.isTrue (startsAtExc andalso movedToH)
end)
]
val tests = concat [hMove, lMove, jMove, kMove, wMove]