17 lines
800 B
JavaScript
17 lines
800 B
JavaScript
import assert from 'node:assert/strict';
|
|
import { access, readFile } from 'node:fs/promises';
|
|
import test from 'node:test';
|
|
const source = JSON.parse(await readFile(new URL('../json/card_source.json', import.meta.url), 'utf8'));
|
|
test('CPP07 identity and task order are stable', () => {
|
|
assert.equal(source.card.number, '07');
|
|
assert.equal(source.card.uuid, '014b68da-1f09-58fb-917a-42b0290e080c');
|
|
assert.deepEqual(source.tasks_order, ['task01', 'task02', 'task03']);
|
|
assert.match(JSON.stringify(source), /C\+\+20/);
|
|
});
|
|
test('all task programs and expected outputs exist', async () => {
|
|
for (const task of ['task01', 'task02', 'task03']) {
|
|
await access(new URL(`../src/${task}/main.cpp`, import.meta.url));
|
|
await access(new URL(`./expected/${task}.txt`, import.meta.url));
|
|
}
|
|
});
|