module tests pass

This commit is contained in:
Umur Ozkul 2022-06-11 15:15:25 +02:00
parent 69bab17331
commit 0704c8d9f5
2 changed files with 3 additions and 2 deletions

View File

@ -2,6 +2,6 @@ open Jest
open Reducer_TestHelpers open Reducer_TestHelpers
describe("Math Library", () => { describe("Math Library", () => {
testEvalToBe("Math.e", "") testEvalToBe("Math.e", "Ok(2.718281828459045)")
testEvalToBe("Math.pi", "") testEvalToBe("Math.pi", "Ok(3.141592653589793)")
}) })

View File

@ -256,6 +256,7 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce
switch call { switch call {
| ("$_atIndex_$", [EvArray(aValueArray), EvNumber(fIndex)]) => arrayAtIndex(aValueArray, fIndex) | ("$_atIndex_$", [EvArray(aValueArray), EvNumber(fIndex)]) => arrayAtIndex(aValueArray, fIndex)
| ("$_atIndex_$", [EvModule(dict), EvString(sIndex)]) => recordAtIndex(dict, sIndex)
| ("$_atIndex_$", [EvRecord(dict), EvString(sIndex)]) => recordAtIndex(dict, sIndex) | ("$_atIndex_$", [EvRecord(dict), EvString(sIndex)]) => recordAtIndex(dict, sIndex)
| ("$_constructArray_$", [EvArray(aValueArray)]) => EvArray(aValueArray)->Ok | ("$_constructArray_$", [EvArray(aValueArray)]) => EvArray(aValueArray)->Ok
| ("$_constructRecord_$", [EvArray(arrayOfPairs)]) => constructRecord(arrayOfPairs) | ("$_constructRecord_$", [EvArray(arrayOfPairs)]) => constructRecord(arrayOfPairs)