diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_MathJs/Reducer_MathJsEval_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_MathJs/Reducer_MathJsEval_test.res index e5009e3e..30feb35f 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_MathJs/Reducer_MathJsEval_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_MathJs/Reducer_MathJsEval_test.res @@ -1,31 +1,31 @@ open ReducerInterface.ExpressionValue -module ME = Reducer.MathJs.Eval +module MathJs = Reducer.MathJs module ErrorValue = Reducer.Error open Jest open ExpectJs describe("eval", () => { - test("Number", () => expect(ME.eval("1"))->toEqual(Ok(EvNumber(1.)))) - test("Number expr", () => expect(ME.eval("1-1"))->toEqual(Ok(EvNumber(0.)))) - test("String", () => expect(ME.eval("'hello'"))->toEqual(Ok(EvString("hello")))) + test("Number", () => expect(MathJs.Eval.eval("1"))->toEqual(Ok(EvNumber(1.)))) + test("Number expr", () => expect(MathJs.Eval.eval("1-1"))->toEqual(Ok(EvNumber(0.)))) + test("String", () => expect(MathJs.Eval.eval("'hello'"))->toEqual(Ok(EvString("hello")))) test("String expr", () => - expect(ME.eval("concat('hello ','world')"))->toEqual(Ok(EvString("hello world"))) + expect(MathJs.Eval.eval("concat('hello ','world')"))->toEqual(Ok(EvString("hello world"))) ) - test("Boolean", () => expect(ME.eval("true"))->toEqual(Ok(EvBool(true)))) - test("Boolean expr", () => expect(ME.eval("2>1"))->toEqual(Ok(EvBool(true)))) + test("Boolean", () => expect(MathJs.Eval.eval("true"))->toEqual(Ok(EvBool(true)))) + test("Boolean expr", () => expect(MathJs.Eval.eval("2>1"))->toEqual(Ok(EvBool(true)))) }) describe("errors", () => { // All those errors propagete up and are returned by the resolver test("unknown function", () => - expect(ME.eval("testZadanga()"))->toEqual( + expect(MathJs.Eval.eval("testZadanga()"))->toEqual( Error(ErrorValue.REJs(Some("Undefined function testZadanga"), Some("Error"))), ) ) test("unknown answer type", () => - expect(ME.eval("1+1i"))->toEqual( + expect(MathJs.Eval.eval("1+1i"))->toEqual( Error(ErrorValue.RETodo("Unhandled MathJs literal type: object")), ) )