Rename eval to evaluate
eval is a JS keyword
This commit is contained in:
parent
d6c541036f
commit
6565d97f53
|
@ -4,7 +4,7 @@ open Jest
|
|||
open Expect
|
||||
|
||||
let expectEvalToBe = (expr: string, answer: string) =>
|
||||
Reducer.eval(expr)->ExpressionValue.toStringResult->expect->toBe(answer)
|
||||
Reducer.evaluate(expr)->ExpressionValue.toStringResult->expect->toBe(answer)
|
||||
|
||||
describe("builtin", () => {
|
||||
// All MathJs operators and functions are available for string, number and boolean
|
||||
|
|
|
@ -8,4 +8,4 @@ let expectParseToBe = (expr: string, answer: string) =>
|
|||
Reducer.parse(expr)->Expression.toStringResult->expect->toBe(answer)
|
||||
|
||||
let expectEvalToBe = (expr: string, answer: string) =>
|
||||
Reducer.eval(expr)->ExpressionValue.toStringResult->expect->toBe(answer)
|
||||
Reducer.evaluate(expr)->ExpressionValue.toStringResult->expect->toBe(answer)
|
||||
|
|
|
@ -5,5 +5,5 @@ module Extra = Reducer_Extra
|
|||
module Js = Reducer_Js
|
||||
module MathJs = Reducer_MathJs
|
||||
|
||||
let eval = Expression.eval
|
||||
let evaluate = Expression.eval
|
||||
let parse = Expression.parse
|
||||
|
|
|
@ -4,5 +4,7 @@ module Expression = Reducer_Expression
|
|||
module Extra = Reducer_Extra
|
||||
module Js = Reducer_Js
|
||||
module MathJs = Reducer_MathJs
|
||||
let eval: string => result<Expression.expressionValue, ErrorValue.errorValue>
|
||||
|
||||
@genType
|
||||
let evaluate: string => result<Expression.expressionValue, ErrorValue.errorValue>
|
||||
let parse: string => result<Expression.expression, ErrorValue.errorValue>
|
||||
|
|
Loading…
Reference in New Issue
Block a user