another splitContinuousAndDiscrete test

This commit is contained in:
Vyacheslav Matyukhin 2022-09-21 02:25:14 +04:00
parent 13f352752e
commit a96f9ffa9a
No known key found for this signature in database
GPG Key ID: 3D2A774C5489F96C

View File

@ -25,6 +25,12 @@ describe("Continuous and discrete splits", () => {
([1.33455, 1.432, 2.0, 2.0, 3.5, 3.5, 3.5], []), ([1.33455, 1.432, 2.0, 2.0, 3.5, 3.5, 3.5], []),
) )
makeTest(
"more general test",
prepareInputs([10., 10., 11., 11., 11., 12., 13., 13., 13., 13., 13., 14.], 3),
([10., 10., 12., 14.], [(11., 3.), (13., 5.)]),
)
let makeDuplicatedArray = count => { let makeDuplicatedArray = count => {
let arr = Belt.Array.range(1, count) |> E.A.fmap(float_of_int) let arr = Belt.Array.range(1, count) |> E.A.fmap(float_of_int)
let sorted = arr |> Belt.SortArray.stableSortBy(_, compare) let sorted = arr |> Belt.SortArray.stableSortBy(_, compare)