test(junction): cover heading wrap stability

This commit is contained in:
que01 committed 2026-09-09 12:15:07 +08:00
1 parent 88fcee94a0
commit af286c6149
1 file changed
+17
@@ -367,3 +367,20 @@ const offsetUnequalGraph = buildJunctionBoundaryGraph(
offsetUnequal.helpers,
);
assertCoreGeometry(offsetUnequal.topology, offsetUnequalGraph, point(0, 0));
const wrappedRotationEntries = sixArmEntries.map((entry) => ({
...entry,
line: entry.line.map((coordinate) => rotate(coordinate, 350)),
}));
const wrappedRotation = fixture('six-arm', wrappedRotationEntries);
const wrappedTopology = resolveJunctionBuildPlan(
wrappedRotation.model,
wrappedRotation.cluster,
wrappedRotation.helpers,
);
assert.deepEqual(
wrappedTopology.arms.map((arm) => arm.key).sort(),
sixArm.topology.arms.map((arm) => arm.key).sort(),
'arm identity must remain stable across the -180/180 heading wrap',
);
assert.equal(wrappedTopology.arms.length, sixArm.topology.arms.length);