From c97c6756428ba3bd75a3618ad83a80d74e929f75 Mon Sep 17 00:00:00 2001 From: Roman Galochkin Date: Tue, 25 Feb 2020 12:52:36 +0300 Subject: [PATCH] Adds tests --- __tests__/CDF__Test.re | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/__tests__/CDF__Test.re b/__tests__/CDF__Test.re index 33ad8700..f5605b68 100644 --- a/__tests__/CDF__Test.re +++ b/__tests__/CDF__Test.re @@ -143,4 +143,26 @@ describe("CDF", () => { expect(Dist2.ys) |> toEqual([|50., 54., 58.|]) }); }); + + // @todo + describe("sample", () => { + open Functions; + let xs = up(1, 9); + let ys = up(70, 78); + module Dist = + CDF.Make({ + let shape = CDF.order({xs, ys}); + }); + + let xs2 = Dist.sample(3); + test("#1", () => { + expect(xs2[0]) |> toBe(70.) + }); + test("#2", () => { + expect(xs2[1]) |> toBe(70.) + }); + test("#3", () => { + expect(xs2[2]) |> toBe(70.) + }); + }); });