squiggle/packages/squiggle-lang/__tests__/Reducer/Reducer_TestHelpers.res
Sam Nolan 6565d97f53 Rename eval to evaluate
eval is a JS keyword
2022-04-11 11:18:38 +10:00

12 lines
383 B
Plaintext

module Expression = Reducer.Expression
module ExpressionValue = ReducerInterface.ExpressionValue
open Jest
open Expect
let expectParseToBe = (expr: string, answer: string) =>
Reducer.parse(expr)->Expression.toStringResult->expect->toBe(answer)
let expectEvalToBe = (expr: string, answer: string) =>
Reducer.evaluate(expr)->ExpressionValue.toStringResult->expect->toBe(answer)