From 80a52a2a7b56ab0d572c423ecd89338e2719317e Mon Sep 17 00:00:00 2001 From: Roman Galochkin Date: Tue, 25 Feb 2020 11:45:44 +0300 Subject: [PATCH] FindY tests --- __tests__/CDF__Test.re | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/__tests__/CDF__Test.re b/__tests__/CDF__Test.re index 4dd926cf..1d318118 100644 --- a/__tests__/CDF__Test.re +++ b/__tests__/CDF__Test.re @@ -54,4 +54,18 @@ describe("CDF", () => { }); expect(Dist.maxX()) |> toEqual(20.); }); + test("findY#1", () => { + module Dist = + CDF.Make({ + let shape = CDF.order({xs: [|1., 2., 3.|], ys: [|5., 6., 7.|]}); + }); + expect(Dist.findY(1.)) |> toEqual(5.); + }); + test("findY#2", () => { + module Dist = + CDF.Make({ + let shape = CDF.order({xs: [|1., 2., 3.|], ys: [|5., 6., 7.|]}); + }); + expect(Dist.findY(1.5)) |> toEqual(5.5); + }); });