Site: close road gaps, ElyMark exports to PDF, test road links; recording fixes
This commit is contained in:
4 files changed
+37
-14
No files matched your search
+3
-2
@@ -38,13 +38,14 @@ const tree = [on(6.5, 7.6, 0.7, 0.7, 2.8), on(8.7, 7.6, 0.7, 0.7, 1.8), on(7.2,
|
|||||||
/** Headings stepping down. */
|
/** Headings stepping down. */
|
||||||
const mark = [0, 1, 2].map((i) => on(1, 7 + i, 3, 1, 2 - i * 0.6));
|
const mark = [0, 1, 2].map((i) => on(1, 7 + i, 3, 1, 2 - i * 0.6));
|
||||||
|
|
||||||
/** Roads: every document exports to PDF; Markdown goes to Git. */
|
/** Roads: exports go to PDF; Markdown goes to Git. */
|
||||||
const road = (x: number, y: number, w: number, d: number) => on(x, y, w, d, 0.08, 0, ACCENT);
|
const road = (x: number, y: number, w: number, d: number) => on(x, y, w, d, 0.08, 0, ACCENT);
|
||||||
const roads = [
|
const roads = [
|
||||||
road(2, 4, 0.6, 0.6),
|
road(2, 4, 0.6, 0.6),
|
||||||
road(6, 4, 0.6, 0.6),
|
road(6, 3.9, 0.6, 0.7),
|
||||||
road(10.7, 2.85, 0.6, 1.75),
|
road(10.7, 2.85, 0.6, 1.75),
|
||||||
road(2, 4.6, 11, 0.6),
|
road(2, 4.6, 11, 0.6),
|
||||||
|
road(2, 5.2, 0.6, 1.8),
|
||||||
road(4, 7.6, 2.5, 0.6),
|
road(4, 7.6, 2.5, 0.6),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -25,3 +25,36 @@ test("the accent covers at most a tenth of the visible tops", () => {
|
|||||||
test("six apps between the desk and the roads", () => {
|
test("six apps between the desk and the roads", () => {
|
||||||
assert.deepEqual(model.slice(1, -1).map((p) => p.name), ["ElyDoc", "ElyTable", "ElyShow", "ElyPDF", "ElyTree", "ElyMark"]);
|
assert.deepEqual(model.slice(1, -1).map((p) => p.name), ["ElyDoc", "ElyTable", "ElyShow", "ElyPDF", "ElyTree", "ElyMark"]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
type Box = (typeof all)[number];
|
||||||
|
const near = (a: number, aw: number, b: number, bw: number) => a <= b + bw + 1e-9 && b <= a + aw + 1e-9;
|
||||||
|
const shared = (a: number, aw: number, b: number, bw: number) => Math.min(a + aw, b + bw) - Math.max(a, b) > 1e-9;
|
||||||
|
/** Two ground blocks meet along an edge or overlap. */
|
||||||
|
const meet = (a: Box, b: Box) =>
|
||||||
|
a.z === b.z && near(a.x, a.w, b.x, b.w) && near(a.y, a.d, b.y, b.d) &&
|
||||||
|
(shared(a.x, a.w, b.x, b.w) || shared(a.y, a.d, b.y, b.d));
|
||||||
|
|
||||||
|
const part = (name: string) => {
|
||||||
|
const found = model.find((p) => p.name === name);
|
||||||
|
assert.ok(found, name);
|
||||||
|
return found.blocks;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Whether roads join two apps' ground blocks. */
|
||||||
|
function linked(from: string, to: string): boolean {
|
||||||
|
const roads = part("Roads");
|
||||||
|
const ground = (name: string) => part(name).filter((b) => b.z === roads[0].z);
|
||||||
|
const start = roads.filter((r) => ground(from).some((b) => meet(r, b)));
|
||||||
|
const seen = new Set(start);
|
||||||
|
for (const r of seen) for (const n of roads) if (!seen.has(n) && meet(r, n)) seen.add(n);
|
||||||
|
return [...seen].some((r) => ground(to).some((b) => meet(r, b)));
|
||||||
|
}
|
||||||
|
|
||||||
|
test("every app has a building", () => {
|
||||||
|
for (const p of model.slice(1, -1)) assert.ok(p.blocks.length > 0, p.name);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("roads carry exports to PDF and Markdown to Git", () => {
|
||||||
|
for (const app of ["ElyDoc", "ElyTable", "ElyShow", "ElyMark"]) assert.ok(linked(app, "ElyPDF"), app);
|
||||||
|
assert.ok(linked("ElyMark", "ElyTree"));
|
||||||
|
});
|
||||||
@@ -63,17 +63,6 @@ wait_log() {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Waits until the AX tree shows text $1.
|
|
||||||
wait_ax() {
|
|
||||||
local i
|
|
||||||
for i in $(seq $((${2:-30} * 2))); do
|
|
||||||
"$bin/ax-values" "$app_pid" | grep -q -- "$1" && return 0
|
|
||||||
sleep 0.5
|
|
||||||
done
|
|
||||||
echo "AX never showed: $1" >&2
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Center "x y" of the first AX line matching $1.
|
# Center "x y" of the first AX line matching $1.
|
||||||
where() {
|
where() {
|
||||||
local i at
|
local i at
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ mark "History tab: graph"
|
|||||||
mouse click $((x + 145)) $((y + 85))
|
mouse click $((x + 145)) $((y + 85))
|
||||||
pause 1.2
|
pause 1.2
|
||||||
mark "open the new commit"
|
mark "open the new commit"
|
||||||
mouse click $((x + 260)) $((y + 220))
|
mouse click $((x + 260)) $((y + 156))
|
||||||
pause 1.0
|
pause 1.0
|
||||||
mouse move $((x + 1000)) $((y + 700)) 0.8
|
mouse move $((x + 1000)) $((y + 700)) 0.8
|
||||||
pause 1.5
|
pause 1.5
|
||||||
|
|||||||
Reference in new issue
Block a user