remove redundant test

This commit is contained in:
2025-09-23 11:11:33 +01:00
parent 4f20379219
commit 5fded45303
2 changed files with 4 additions and 34 deletions

View File

@@ -1,6 +1,2 @@
let hello world
hello time to go
world
in
0
end

View File

@@ -299,7 +299,7 @@ struct
in in
Expect.isTrue (c1 andalso c2 andalso c3) Expect.isTrue (c1 andalso c2 andalso c3)
end) 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 let
(* arrange *) (* arrange *)
val str = "hello \nworld \ntime to go\n" val str = "hello \nworld \ntime to go\n"
@@ -310,35 +310,9 @@ struct
(* act *) (* act *)
val {cursorIdx, ...} = TestUtils.update (app, CHAR_EVENT #"j") 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 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 *) (* assert *)
(* String.size str - 1 is a valid char position Expect.isTrue (cursorIdx = initialCursorIdx)
* 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
end) end)
, test "goes to next idx when cursor is on a newline" (fn _ => , test "goes to next idx when cursor is on a newline" (fn _ =>
let let