add a new failing test, and modify 'TestUtils.init' function (which takes a string and returns an AppType.app_type) so that it does not automatically add a newline to the end of strings. (This modification required changing the strings in some tests, as those strings did not have newlines at the end but the test assumes they did.)

This commit is contained in:
2025-09-23 13:18:36 +01:00
parent 2376ae07b5
commit 109fda187a
2 changed files with 84 additions and 55 deletions

View File

@@ -1,17 +1,8 @@
structure TestUtils =
struct
fun withUnixLineEndings str =
if String.size str > 0 andalso String.sub (str, String.size str - 1) = #"\n" then
str
else
str ^ "\n"
fun init bufferString =
let
val bufferString = withUnixLineEndings bufferString
val buffer = LineGap.fromString bufferString
in
AppType.init (buffer, 0, 0, Time.now ())
let val buffer = LineGap.fromString bufferString
in AppType.init (buffer, 0, 0, Time.now ())
end
fun update (app, cmd) =