From 40f4db5eb14974e9d0be0dfeccc4e92bc8e510ce Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Wed, 22 Jun 2022 17:51:14 -0400 Subject: [PATCH] fixed all tests by switching to integer. it does not make sense. --- packages/squiggle-lang/__tests__/TS/Jstat_test.ts | 4 ++-- packages/squiggle-lang/__tests__/TS/Scalars_test.ts | 4 ++-- packages/squiggle-lang/__tests__/TS/Symbolic_test.ts | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/squiggle-lang/__tests__/TS/Jstat_test.ts b/packages/squiggle-lang/__tests__/TS/Jstat_test.ts index 2d2e5619..039c517a 100644 --- a/packages/squiggle-lang/__tests__/TS/Jstat_test.ts +++ b/packages/squiggle-lang/__tests__/TS/Jstat_test.ts @@ -5,7 +5,7 @@ import { testRun } from "./TestHelpers"; describe("cumulative density function of a normal distribution", () => { test("at 3 stdevs to the right of the mean is near 1", () => { fc.assert( - fc.property(fc.double(), fc.double({ min: 1e-7 }), (mean, stdev) => { + fc.property(fc.integer(), fc.integer({ min: 1 }), (mean, stdev) => { let threeStdevsAboveMean = mean + 3 * stdev; let squiggleString = `cdf(normal(${mean}, ${stdev}), ${threeStdevsAboveMean})`; let squiggleResult = testRun(squiggleString); @@ -16,7 +16,7 @@ describe("cumulative density function of a normal distribution", () => { test("at 3 stdevs to the left of the mean is near 0", () => { fc.assert( - fc.property(fc.double(), fc.double({ min: 1e-7 }), (mean, stdev) => { + fc.property(fc.integer(), fc.integer({ min: 1 }), (mean, stdev) => { let threeStdevsBelowMean = mean - 3 * stdev; let squiggleString = `cdf(normal(${mean}, ${stdev}), ${threeStdevsBelowMean})`; let squiggleResult = testRun(squiggleString); diff --git a/packages/squiggle-lang/__tests__/TS/Scalars_test.ts b/packages/squiggle-lang/__tests__/TS/Scalars_test.ts index cbd1273f..4dd33ab7 100644 --- a/packages/squiggle-lang/__tests__/TS/Scalars_test.ts +++ b/packages/squiggle-lang/__tests__/TS/Scalars_test.ts @@ -5,7 +5,7 @@ import * as fc from "fast-check"; describe("Scalar manipulation is well-modeled by javascript math", () => { test("in the case of natural logarithms", () => { fc.assert( - fc.property(fc.float(), (x) => { + fc.property(fc.integer(), (x) => { let squiggleString = `log(${x})`; let squiggleResult = testRun(squiggleString); if (x == 0) { @@ -19,7 +19,7 @@ describe("Scalar manipulation is well-modeled by javascript math", () => { test("in the case of addition (with assignment)", () => { fc.assert( - fc.property(fc.float(), fc.float(), fc.float(), (x, y, z) => { + fc.property(fc.integer(), fc.integer(), fc.integer(), (x, y, z) => { let squiggleString = `x = ${x}; y = ${y}; z = ${z}; x + y + z`; let squiggleResult = testRun(squiggleString); expect(squiggleResult.value).toBeCloseTo(x + y + z); diff --git a/packages/squiggle-lang/__tests__/TS/Symbolic_test.ts b/packages/squiggle-lang/__tests__/TS/Symbolic_test.ts index 483df95f..2411cd79 100644 --- a/packages/squiggle-lang/__tests__/TS/Symbolic_test.ts +++ b/packages/squiggle-lang/__tests__/TS/Symbolic_test.ts @@ -1,11 +1,10 @@ -import { errorValueToString } from "../../src/js/index"; import { testRun } from "./TestHelpers"; import * as fc from "fast-check"; describe("Symbolic mean", () => { test("mean(triangular(x,y,z))", () => { fc.assert( - fc.property(fc.double(), fc.double(), fc.double(), (x, y, z) => { + fc.property(fc.integer(), fc.integer(), fc.integer(), (x, y, z) => { if (!(x < y && y < z)) { try { let squiggleResult = testRun(`mean(triangular(${x},${y},${z}))`);