add failing test for PersistentVector.extendExistingMatch. (Need to fix.)

This commit is contained in:
2026-02-07 00:33:29 +00:00
parent 0ea0d44da3
commit 7fa573334f

View File

@@ -592,6 +592,31 @@ struct
in in
Expect.isTrue (outputList = expectedOutput) Expect.isTrue (outputList = expectedOutput)
end) end)
, test
"removes all subsequent elements when new 'finish' is greater \
\than any finish in the vector"
(fn _ =>
let
(* arrange *)
val inputList = List.tabulate (500, fn i =>
{start = i, finish = i})
val pv = PersistentVector.fromList inputList
(* act *)
val pv = PersistentVector.extendExistingMatch (5, 999, pv)
(* assert *)
val outputList = PersistentVector.toList pv
val expectedOutput =
[ {start = 1, finish = 1}
, {start = 2, finish = 2}
, {start = 3, finish = 3}
, {start = 4, finish = 4}
, {start = 5, finish = 999}
]
in
Expect.isTrue (outputList = expectedOutput)
end)
] ]
val tests = val tests =