diff --git a/test/junction-build-plan-counterexamples.js b/test/junction-build-plan-counterexamples.js index e77de75..1834db8 100644 --- a/test/junction-build-plan-counterexamples.js +++ b/test/junction-build-plan-counterexamples.js @@ -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);