From 5fded45303948ba08b53dc9ef3a3b9d3641435d6 Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Tue, 23 Sep 2025 11:11:33 +0100 Subject: [PATCH] remove redundant test --- temp.txt | 8 ++------ test/normal-move.sml | 30 ++---------------------------- 2 files changed, 4 insertions(+), 34 deletions(-) diff --git a/temp.txt b/temp.txt index 338e9c4..e3652ac 100644 --- a/temp.txt +++ b/temp.txt @@ -1,6 +1,2 @@ -let -hello -world -in -0 -end +hello world +time to go diff --git a/test/normal-move.sml b/test/normal-move.sml index eb3778e..0fa5e0a 100644 --- a/test/normal-move.sml +++ b/test/normal-move.sml @@ -299,7 +299,7 @@ struct in Expect.isTrue (c1 andalso c2 andalso c3) end) - , test "leaves cursor at same idx if on the last line" (fn _ => + , test "leaves cursor at same idx when on the last line" (fn _ => let (* arrange *) val str = "hello \nworld \ntime to go\n" @@ -310,35 +310,9 @@ struct (* act *) val {cursorIdx, ...} = TestUtils.update (app, CHAR_EVENT #"j") - - (* assert *) - (* String.size str - 1 is a valid char position - * but we are counting String.size str - 2 as the end - * because, in Vim, saved files always end with \n - * but the last char, \n, is not visible *) - val isAtEnd = cursorIdx = initialCursorIdx in - Expect.isTrue isAtEnd - end) - , test "leaves cursor at same idx when already on last line" (fn _ => - let - (* arrange *) - val str = "hello \nworld \ntime to go\n" - val len = String.size str - 2 - val app = TestUtils.init str - val app = AppWith.idx (app, len) - - (* act *) - val {cursorIdx, ...} = TestUtils.update (app, CHAR_EVENT #"j") - (* assert *) - (* String.size str - 1 is a valid char position - * but we are counting String.size str - 2 as the end - * because, in Vim, saved files always end with \n - * but the last char, \n, is not visible *) - val isAtEnd = cursorIdx = len - in - Expect.isTrue isAtEnd + Expect.isTrue (cursorIdx = initialCursorIdx) end) , test "goes to next idx when cursor is on a newline" (fn _ => let