From 4c5c1f304ac76eb13fe12ec827c8f42d1aa83a68 Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Sun, 21 Sep 2025 21:45:30 +0100 Subject: [PATCH] amend a test to respect new viH implementation --- test/normal-move.sml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/test/normal-move.sml b/test/normal-move.sml index 496aa70..f2f04b5 100644 --- a/test/normal-move.sml +++ b/test/normal-move.sml @@ -54,8 +54,8 @@ struct Expect.isTrue (cursorIdx = 4) end) , test - "moves cursor to first newline when cursor is currently on char\ - \ after a double newline" + "moves cursor past first newline immediately following \ + \a non-newline character" (fn _ => let (* arrange *) @@ -66,7 +66,22 @@ struct val {cursorIdx, ...} = TestUtils.update (app, CHAR_EVENT #"h") in (* assert *) - Expect.isTrue (cursorIdx = 5) + Expect.isTrue (cursorIdx = 6) + end) + , test + "moves cursor past newline when we see, to the left, \ + \ a newline with a chr prior to it" + (fn _ => + let + (* arrange *) + val app = TestUtils.init "hello\nworld" + val app = AppWith.idx (app, 6) + + (* act *) + val {cursorIdx, ...} = TestUtils.update (app, CHAR_EVENT #"h") + in + (* assert *) + Expect.isTrue (cursorIdx = 4) end) , test "moves cursor to odd-numbered newline when cursor is currently on char\