Initial commit

This commit is contained in:
ryanfitzpatrickio
2026-08-03 10:28:11 -05:00
parent 65bfc3dcb4
commit 6c08153e42
63 changed files with 15790 additions and 1 deletions
+28
View File
@@ -0,0 +1,28 @@
/** The smallest test harness that gives a useful failure message. */
let failures = 0;
let checks = 0;
export function ok(cond, msg) {
checks++;
if (!cond) {
failures++;
console.error(' FAIL ' + msg);
}
}
export function near(actual, expected, tol, msg) {
ok(Math.abs(actual - expected) <= tol, `${msg} (got ${actual}, want ${expected} ±${tol})`);
}
export function section(name) {
console.log('· ' + name);
}
export function done(name) {
if (failures) {
console.error(`\n${name}: ${failures} of ${checks} checks failed`);
process.exit(1);
}
console.log(`${name}: ${checks} checks passed`);
}