cps-interpreter/test/parser.spec.ts

16 lines
447 B
TypeScript
Raw Normal View History

2024-02-23 19:27:16 -05:00
import { expect, test } from 'bun:test';
import { TestPrograms } from './programs';
import { peggyParse } from '@/parser';
test('Primitive Operations', async () => {
2024-02-26 19:58:53 -05:00
const [operation] = peggyParse(await TestPrograms.AddOneThree);
const { primitiveOperation } = operation;
expect(primitiveOperation).toEqual({
opr: '+',
operands: [{ real: 1 }, { int: 3 }],
resultBindings: [{ name: 'result' }],
continuations: [],
});
2024-02-23 19:27:16 -05:00
});