Files
sophon-realtime-guide/validate.mjs
T

14 lines
601 B
JavaScript

import { readFileSync } from "node:fs";
import assert from "node:assert/strict";
const html = readFileSync(new URL("./index.html", import.meta.url), "utf8");
const ids = [...html.matchAll(/\bid="([^"]+)"/g)].map((match) => match[1]);
assert.equal(ids.length, new Set(ids).size);
for (const match of html.matchAll(/href="#([^"]+)"/g)) {
assert.ok(ids.includes(match[1]), `Missing anchor ${match[1]}`);
}
assert.ok(html.includes("GPU 推理待实测"));
assert.ok(html.includes("mock"));
assert.ok(html.includes("special"));
console.log(`Validated ${ids.length} anchors and model evidence labels.`);