Files
Ely-GPUI-Components/frontend/src/iso/mark.test.ts
T
ZacharyZhang-NYandClaude Opus 5.5 20a8e2b0ee Site · Logo: the letter E in iso blocks, in the header, the favicon, the touch icon and the OG image
One geometry in src/iso/mark.ts, drawn by the engine the miniatures use. The favicon follows the system's mode; scripts/favicon.mjs takes its colors from styles.css. Below 768px the header shows the mark alone, its word kept as the link's name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 22:19:04 -04:00

25 lines
1.0 KiB
TypeScript

import assert from "node:assert/strict";
import { test } from "node:test";
import { mark, points } from "./mark.ts";
test("the mark draws three faces of each of its four blocks, the middle arm's in the accent", () => {
const { polygons } = mark(0);
assert.equal(polygons.length, 12);
assert.equal(polygons.filter((p) => p.accent).length, 3);
assert.deepEqual(polygons.slice(0, 3).map((p) => p.face), ["right", "front", "top"]);
});
test("the mark fills its box less the padding", () => {
const pad = 0.5;
const { width, height, polygons } = mark(pad);
const all = polygons.flatMap((p) => p.points);
const [xs, ys] = [all.map(([x]) => x), all.map(([, y]) => y)];
assert.ok(Math.abs(Math.min(...xs) - pad) < 1e-9 && Math.abs(Math.max(...xs) - (width - pad)) < 1e-9);
assert.ok(Math.abs(Math.min(...ys) - pad) < 1e-9 && Math.abs(Math.max(...ys) - (height - pad)) < 1e-9);
assert.ok(height > width, "the E stands taller than wide");
});
test("points print as an SVG list", () => {
assert.equal(points([[1, 2.5], [0.12345, 3]]), "1,2.5 0.123,3");
});