test(junction): cover short transition rejection
This commit is contained in:
1 parent
a476faf171
commit
a6121aecfe
1 file changed
+17
@@ -414,3 +414,20 @@ assert.deepEqual(
|
||||
translatedTopology.carriageways.map((item) => item.entrySection.feasibility),
|
||||
sixArm.topology.carriageways.map((item) => item.entrySection.feasibility),
|
||||
);
|
||||
|
||||
const tooShort = topology('too-short-transition', [
|
||||
{ widthMeters: 6, line: [point(0, 0), point(0, 7)] },
|
||||
{ widthMeters: 6, line: [point(0, 0), point(35, 0)] },
|
||||
{ widthMeters: 6, line: [point(0, 0), point(-35, 0)] },
|
||||
]);
|
||||
const tooShortGraph = buildJunctionBoundaryGraph(
|
||||
tooShort.topology,
|
||||
point(0, 0),
|
||||
{ outerRadiusFor: () => 24, innerRadiusFor: () => 10 },
|
||||
tooShort.helpers,
|
||||
);
|
||||
const tooShortSection = tooShortGraph.sections.find(
|
||||
(section) => section.carriagewayKey === tooShort.topology.carriageways[0].key,
|
||||
);
|
||||
assert.equal(tooShortSection.transitionStatus, 'insufficient-source-length');
|
||||
assert.equal(tooShortSection.transitionMeters, 0);
|
||||
Reference in new issue
Block a user