From 51c9090adf6342f9e3f05eadfacef410d7d6a632 Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Mon, 21 Jul 2025 00:28:25 +0100 Subject: [PATCH] add a test for 'b' motion, checking that we move to start of prev word when on first character of next word --- test/normal-move.sml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/normal-move.sml b/test/normal-move.sml index 9d7eaca..81089bc 100644 --- a/test/normal-move.sml +++ b/test/normal-move.sml @@ -1118,6 +1118,19 @@ struct (* assert *) Expect.isTrue (cursorIdx = 0) end) + , test "moves cursor previous word when on first character of next word" + (fn _ => + let + val buffer = LineGap.fromString "hello world\n" + val app = AppType.init (buffer, 0, 0) + val app = AppWith.idx (app, 6) + val chr1 = getChr app + + val app2 = AppUpdate.update (app, CHAR_EVENT #"b") + val chr2 = getChr app2 + in + Expect.isTrue (chr1 = #"w" andalso chr2 = #"h") + end) , test "moves cursor to 0 when cursor > 0 and cursor is on first word" (fn _ => let