2026-09-24 14:38:07 -04:00
|
|
|
<!doctype html>
|
|
|
|
|
<html lang="en"><head><meta charset="utf-8"><title>selftest</title>
|
|
|
|
|
<style>
|
|
|
|
|
body{background:#0b0d13;color:#e8eaf0;font:13px/1.6 ui-monospace,Menlo,monospace;padding:20px}
|
|
|
|
|
li{list-style:none} .p{color:#4ade80} .f{color:#f87171}
|
|
|
|
|
b{font-weight:400;color:#8891a5} h1{font-size:14px}
|
|
|
|
|
</style></head><body>
|
|
|
|
|
<h1 id="head">running…</h1><ul id="out"></ul>
|
|
|
|
|
<script type="module">
|
2026-09-24 15:25:39 -04:00
|
|
|
import { run, runWiring } from './js/selftest.js';
|
2026-09-24 14:38:07 -04:00
|
|
|
let res;
|
|
|
|
|
try { res = run(); }
|
|
|
|
|
catch (e) { res = [{ name: 'harness threw: ' + e.message, pass: false, detail: String(e.stack).split('\n')[1] || '' }]; }
|
2026-09-24 15:25:39 -04:00
|
|
|
res = res.concat(await runWiring());
|
2026-09-24 14:38:07 -04:00
|
|
|
const pass = res.filter(r => r.pass).length;
|
|
|
|
|
const fail = res.length - pass;
|
|
|
|
|
document.getElementById('head').textContent = `${fail === 0 ? 'PASS' : 'FAIL'} — ${pass}/${res.length} assertions`;
|
|
|
|
|
document.title = `${fail === 0 ? 'PASS' : 'FAIL'} ${pass}/${res.length}`;
|
|
|
|
|
document.getElementById('out').innerHTML = res.map(r =>
|
|
|
|
|
`<li class="${r.pass ? 'p' : 'f'}">${r.pass ? '✓' : '✗'} ${r.name}${r.detail ? ` <b>${r.detail}</b>` : ''}</li>`).join('');
|
|
|
|
|
</script></body></html>
|