2022-03-29 09:09:59 +00:00
|
|
|
module Expression = Reducer.Expression
|
|
|
|
module ExpressionValue = ReducerInterface.ExpressionValue
|
2022-03-24 12:41:31 +00:00
|
|
|
|
|
|
|
open Jest
|
|
|
|
open Expect
|
|
|
|
|
|
|
|
let expectParseToBe = (expr: string, answer: string) =>
|
2022-03-30 10:53:36 +00:00
|
|
|
Reducer.parse(expr)->Expression.toStringResult->expect->toBe(answer)
|
2022-03-24 12:41:31 +00:00
|
|
|
|
|
|
|
let expectEvalToBe = (expr: string, answer: string) =>
|
2022-04-08 07:28:09 +00:00
|
|
|
Reducer.evaluate(expr)->ExpressionValue.toStringResult->expect->toBe(answer)
|
2022-03-24 12:41:31 +00:00
|
|
|
|
|
|
|
// Current configuration does not ignore this file so we have to have a test
|
|
|
|
test("test helpers", () => expect(1)->toBe(1))
|