From 490e4908e171627a88ae752de7181685858a8bb4 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Mon, 2 May 2022 23:18:36 +0200 Subject: [PATCH] sam's monkeying --- .../Reducer/Reducer_functionTricks_test.res | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_functionTricks_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_functionTricks_test.res index f134c309..b425c88e 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_functionTricks_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_functionTricks_test.res @@ -38,7 +38,7 @@ describe("symbol not defined", () => { testEvalToBe("f(x)=x(1); f(2)", "Error(2 is not a function)") }) -Only.describe("call and bindings", () => { +describe("call and bindings", () => { testEvalToBe("f(x)=x+1", "Ok({f: lambda(x=>internal code)})") testEvalToBe("f(x)=x+1; f(1)", "Ok(2)") testEvalToBe("f=1;y=2", "Ok({f: 1,y: 2})") @@ -62,9 +62,11 @@ Only.describe("call and bindings", () => { testEvalToBe("f(x)=x+1; g(x)=f(x)+1; g(2)", "Ok(4)") }) -Skip.describe("function trics", () => { - MySkip.testParseToBe("f(x)=f(y)=2; f(2)", "????") // TODO: No multiple assignment - MySkip.testEvalToBe("f(x)=f(y)=2; f(2)", "????") // TODO: No multiple assignment - MySkip.testEvalToBe("y=2;g(x)=y+1;g(2)", "????") //TODO : y is not found - MySkip.testEvalToBe("y=2;g(x)=inspect(y)+1", "????") //TODO : 666 +describe("function trics", () => { + testParseToBe( + "f(x)=f(y)=2; f(2)", + "Ok((:$$block (:$$block (:$let :f (:$$lambda [x] (:$$block (:$let :f (:$$lambda [y] (:$$block 2)))))) (:f 2))))") + testEvalToBe("f(x)=f(y)=2; f(2)","Ok({f: lambda(y=>internal code),x: 2})") + testEvalToBe("y=2;g(x)=y+1;g(2)", "Ok(3)") + testEvalToBe("y=2;g(x)=inspect(y)+1", "Ok({g: lambda(x=>internal code),y: 2})") })