feat(L03): add blinker and synchronous logic card
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { 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('L03 has stable identity and three ready tasks', () => {
|
||||
assert.equal(source.card.series, 'rv32i-asm');
|
||||
assert.equal(source.card.number, '03');
|
||||
assert.equal(source.card.uuid, '99190b6d-b15a-5757-8794-edd283c40f93');
|
||||
assert.deepEqual(source.tasks_order, ['task01', 'task02', 'task03']);
|
||||
assert.deepEqual(source.front_page_scope.scope_table.rows.map(row => row.status), ['ready', 'ready', 'ready']);
|
||||
});
|
||||
|
||||
test('each task follows predict, measure and evidence contract', () => {
|
||||
const text = JSON.stringify(source);
|
||||
for (const expected of ['clock enable', 'VCD', 'wrap=1,2']) assert.match(text, new RegExp(expected, 'i'));
|
||||
for (const task of Object.values(source.tasks)) {
|
||||
assert.ok(task.criterion.length > 10);
|
||||
assert.equal(task.assessment_criterion_ref, 'RV03.KW01');
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user