squiggle/packages/squiggle-lang/__tests__/Reducer/Reducer_externalBindings_test.res
Umur Ozkul ac3fa859c0 Replace $$_block__$$ with {}
More redable language tests
2022-05-29 17:55:01 +02:00

12 lines
534 B
Plaintext

// TODO: Reimplement with usual parse
open Jest
open Reducer_TestHelpers
describe("Eval with Bindings", () => {
testEvalBindingsToBe("x", list{("x", ExpressionValue.EvNumber(1.))}, "Ok(1)")
testEvalBindingsToBe("x+1", list{("x", ExpressionValue.EvNumber(1.))}, "Ok(2)")
testParseToBe("y = x+1; y", "Ok({(:$_let_$ :y {(:add :x 1)}); :y})")
testEvalBindingsToBe("y = x+1; y", list{("x", ExpressionValue.EvNumber(1.))}, "Ok(2)")
testEvalBindingsToBe("y = x+1", list{("x", ExpressionValue.EvNumber(1.))}, "Ok({x: 1,y: 2})")
})