silphius/app/astride/evaluators/literal.test.js
2024-06-22 08:02:23 -05:00

15 lines
402 B
JavaScript

import {expect, test} from 'vitest';
import evaluate from '@/astride/evaluate.js';
import expression from '@/astride/test/expression.js';
test('evaluates numeric literals', async () => {
expect(evaluate(await expression('1')))
.to.deep.include({value: 1});
});
test('evaluates string literals', async () => {
expect(evaluate(await expression('"1"')))
.to.deep.include({value: '1'});
});