From 26433c52892e296110c490f3f725c408ee3ed64a Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Mon, 11 Apr 2022 16:31:54 +1000 Subject: [PATCH] Fix failing tests based on new toString --- packages/squiggle-lang/__tests__/JS__Test.ts | 2 +- packages/squiggle-lang/src/js/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/squiggle-lang/__tests__/JS__Test.ts b/packages/squiggle-lang/__tests__/JS__Test.ts index 67e42e55..be276a93 100644 --- a/packages/squiggle-lang/__tests__/JS__Test.ts +++ b/packages/squiggle-lang/__tests__/JS__Test.ts @@ -58,7 +58,7 @@ describe("Distribution", () => { }); test("toPointSet", () => { expect( - resultMap(dist.toPointSet(), (r: Distribution) => r.toString()).value + resultMap(dist.toPointSet(), (r: Distribution) => r.toString()) ).toEqual(Ok("Point Set Distribution")); }); test("toSparkline", () => { diff --git a/packages/squiggle-lang/src/js/index.ts b/packages/squiggle-lang/src/js/index.ts index 35fa0537..2d331c6e 100644 --- a/packages/squiggle-lang/src/js/index.ts +++ b/packages/squiggle-lang/src/js/index.ts @@ -210,7 +210,7 @@ export class Distribution { toString(): string { let result = Constructors_toString({ env: this.env }, this.t); if(result.tag === "Ok"){ - result.value + return result.value } else { return distributionErrorToString(result.value)