From 00d7304b4b409950048a85d671761d6d53145980 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Sun, 29 May 2022 17:56:37 +0200 Subject: [PATCH] format --- .../Reducer_Dispatch_BuiltInMacros_test.res | 6 +--- .../Reducer_Peggy_ToExpression_test.res | 33 +++---------------- .../Reducer_functionAssignment_test.res | 5 +-- .../ReducerInterface_Distribution_test.res | 15 ++------- 4 files changed, 10 insertions(+), 49 deletions(-) diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltInMacros_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltInMacros_test.res index e5450ec8..4b506a15 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltInMacros_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltInMacros_test.res @@ -88,11 +88,7 @@ describe("block", () => { ) testMacroEval([], eBlock(list{exampleStatementY, exampleStatementZ}), "Ok({y: 1,z: 1})") // Block inside a block - testMacro( - [], - eBlock(list{eBlock(list{exampleExpression})}), - "Ok((:$$_bindExpression_$$ {1}))", - ) + testMacro([], eBlock(list{eBlock(list{exampleExpression})}), "Ok((:$$_bindExpression_$$ {1}))") testMacroEval([], eBlock(list{eBlock(list{exampleExpression})}), "Ok(1)") // Block assigned to a variable testMacro( diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_test.res index 63ab2064..6091e6fe 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_test.res @@ -58,12 +58,7 @@ describe("Peggy to Expression", () => { describe("multi-line", () => { testToExpression("x=1; 2", "{(:$_let_$ :x {1}); 2}", ~v="2", ()) - testToExpression( - "x=1; y=2", - "{(:$_let_$ :x {1}); (:$_let_$ :y {2})}", - ~v="{x: 1,y: 2}", - (), - ) + testToExpression("x=1; y=2", "{(:$_let_$ :x {1}); (:$_let_$ :y {2})}", ~v="{x: 1,y: 2}", ()) }) describe("variables", () => { @@ -97,12 +92,7 @@ describe("Peggy to Expression", () => { ~v="['hello','world']", (), ) - testToExpression( - "([0,1,2])[1]", - "{(:$_atIndex_$ (:$_constructArray_$ (0 1 2)) 1)}", - ~v="1", - (), - ) + testToExpression("([0,1,2])[1]", "{(:$_atIndex_$ (:$_constructArray_$ (0 1 2)) 1)}", ~v="1", ()) }) describe("records", () => { @@ -174,16 +164,8 @@ describe("Peggy to Expression", () => { }) describe("if then else", () => { - testToExpression( - "if true then 2 else 3", - "{(:$$_ternary_$$ true {2} {3})}", - (), - ) - testToExpression( - "if true then {2} else {3}", - "{(:$$_ternary_$$ true {2} {3})}", - (), - ) + testToExpression("if true then 2 else 3", "{(:$$_ternary_$$ true {2} {3})}", ()) + testToExpression("if true then {2} else {3}", "{(:$$_ternary_$$ true {2} {3})}", ()) testToExpression( "if false then {2} else if false then {4} else {5}", "{(:$$_ternary_$$ false {2} (:$$_ternary_$$ false {4} {5}))}", @@ -215,12 +197,7 @@ describe("Peggy to Expression", () => { }) describe("lambda", () => { - testToExpression( - "{|x| x}", - "{(:$$_lambda_$$ [x] {:x})}", - ~v="lambda(x=>internal code)", - (), - ) + testToExpression("{|x| x}", "{(:$$_lambda_$$ [x] {:x})}", ~v="lambda(x=>internal code)", ()) testToExpression( "f={|x| x}", "{(:$_let_$ :f {(:$$_lambda_$$ [x] {:x})})}", diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_functionAssignment_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_functionAssignment_test.res index b4c367a0..30725cfe 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_functionAssignment_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_functionAssignment_test.res @@ -3,10 +3,7 @@ open Reducer_TestHelpers describe("Parse function assignment", () => { testParseToBe("f(x)=x", "Ok({(:$_let_$ :f (:$$_lambda_$$ [x] {:x}))})") - testParseToBe( - "f(x)=2*x", - "Ok({(:$_let_$ :f (:$$_lambda_$$ [x] {(:multiply 2 :x)}))})", - ) + testParseToBe("f(x)=2*x", "Ok({(:$_let_$ :f (:$$_lambda_$$ [x] {(:multiply 2 :x)}))})") //MathJs does not allow blocks in function definitions }) diff --git a/packages/squiggle-lang/__tests__/ReducerInterface/ReducerInterface_Distribution_test.res b/packages/squiggle-lang/__tests__/ReducerInterface/ReducerInterface_Distribution_test.res index b8291698..a2fa37df 100644 --- a/packages/squiggle-lang/__tests__/ReducerInterface/ReducerInterface_Distribution_test.res +++ b/packages/squiggle-lang/__tests__/ReducerInterface/ReducerInterface_Distribution_test.res @@ -139,18 +139,9 @@ describe("parse on distribution functions", () => { "Ok((:$$_block_$$ (:dotSubtract (:normal 5 2) (:normal 5 1))))", // TODO: !!! returns "Ok({(:dotPow (:normal 5 2) (:normal 5 1))})" ) - testParse( - "normal(5,2) .* normal(5,1)", - "Ok({(:dotMultiply (:normal 5 2) (:normal 5 1))})", - ) - testParse( - "normal(5,2) ./ normal(5,1)", - "Ok({(:dotDivide (:normal 5 2) (:normal 5 1))})", - ) - testParse( - "normal(5,2) .^ normal(5,1)", - "Ok({(:dotPow (:normal 5 2) (:normal 5 1))})", - ) + testParse("normal(5,2) .* normal(5,1)", "Ok({(:dotMultiply (:normal 5 2) (:normal 5 1))})") + testParse("normal(5,2) ./ normal(5,1)", "Ok({(:dotDivide (:normal 5 2) (:normal 5 1))})") + testParse("normal(5,2) .^ normal(5,1)", "Ok({(:dotPow (:normal 5 2) (:normal 5 1))})") }) describe("equality", () => { testParse("5 == normal(5,2)", "Ok({(:equal 5 (:normal 5 2))})")