summaryrefslogtreecommitdiff
path: root/test/interpreter.spec.ts
diff options
context:
space:
mode:
authorLizzy Hunt <lizzy.hunt@usu.edu>2024-03-05 14:49:46 -0700
committerLizzy Hunt <lizzy.hunt@usu.edu>2024-03-05 14:56:17 -0700
commit5e9a34e64254000b9922d69697774c430cdeca36 (patch)
treece6c14e7ff698c668d209282720a66e6af1674d0 /test/interpreter.spec.ts
parent2f77b3fb5a102224c83db2f1fa093c278db716e5 (diff)
downloadcps-interpreter-5e9a34e64254000b9922d69697774c430cdeca36.tar.gz
cps-interpreter-5e9a34e64254000b9922d69697774c430cdeca36.zip
fix parsing of RecordExpressions
Diffstat (limited to 'test/interpreter.spec.ts')
-rw-r--r--test/interpreter.spec.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/interpreter.spec.ts b/test/interpreter.spec.ts
index 6d3189a..acca7bb 100644
--- a/test/interpreter.spec.ts
+++ b/test/interpreter.spec.ts
@@ -45,3 +45,10 @@ test('Application of identity function', async () => {
const result = await evaluate(ast, testingLogger);
expect(result).toEqual({ type: 'int', value: 3 });
});
+
+test('Record construction', async () => {
+ const ast = peggyParse(await TestPrograms.RecordConstruction);
+
+ const result = await evaluate(ast, testingLogger);
+ expect(result).toEqual({ type: 'int', value: 3 });
+});