8e318a8aa9
removed some extra array references rename Builder to ExpressionBuilder Expression Builder Trash Warning remove parsePartial/Outer, add context to lambda format module Bindings simplify types module Macro reduceValueList do macro call result map bindings stop replacing on macro calls Macro Test doBindStatement bind a statement bindings tested. TODO bind shadowing in lambda block tests defined block tests defined blocks tested macro lambda test defined
13 lines
421 B
Plaintext
13 lines
421 B
Plaintext
open Jest
|
|
open Reducer_TestHelpers
|
|
|
|
describe("Parse function assignment", () => {
|
|
testParseToBe("f(x)=x", "Ok((:$$block (:$let :f (:$$lambda [x] (:$$block :x)))))")
|
|
testParseToBe("f(x)=2*x", "Ok((:$$block (:$let :f (:$$lambda [x] (:$$block (:multiply 2 :x))))))")
|
|
//MathJs does not allow blocks in function definitions
|
|
})
|
|
|
|
describe("Evaluate function assignment", () => {
|
|
testEvalToBe("f(x)=x; f(1)", "Ok(1)")
|
|
})
|