Merge #116: Add Düsseldorf with the Altbier-IX (#108)

# Conflicts:
#	CHANGELOG.md
This commit is contained in:
Frederic Jung 2026-10-26 15:08:22 +01:00
commit dbc212dccb
No known key found for this signature in database
6 changed files with 22 additions and 13 deletions

View file

@ -199,7 +199,8 @@ test('#16 shark-averse customers only ask for routes that can stay on land', ()
let shark = 0, bad = [];
for (let i = 0; i < 1500; i++) {
const o = JSON.parse(ev("S.offers=[];spawnOffer();JSON.stringify(S.offers.filter(o=>(o.reqs||[]).includes('sharks')).map(o=>[o.city,o.city2]))"));
for (const [a, b] of o) { shark++; if (ev(`CITY['${a}'].land!==CITY['${b}'].land`)) bad.push(a + '-' + b); }
// isSub, not .land: Cairo sits on two landmasses, so Mumbai to Cairo stays on land.
for (const [a, b] of o) { shark++; if (ev(`isSub('${a}','${b}')`)) bad.push(a + '-' + b); }
}
assert.ok(shark > 0, 'the requirement still shows up');
assert.deepEqual(bad, [], 'never across an ocean');

View file

@ -507,7 +507,7 @@ test('#79 Benelux: Brussels red tape, the Flanders duopoly, Oostkamp trawlers an
assert.deepEqual(errors, []);
});
test('Stuttgart sits between Frankfurt and Zurich, and Hamburg and Munich are on the map', () => {
test('Stuttgart sits between Frankfurt and Zurich, and Hamburg, Munich and Düsseldorf are on the map', () => {
const { ev, errors } = load();
const y = c => ev(`CITY.${c}.y`), x = c => ev(`CITY.${c}.x`);
assert.ok(y('fra') < y('stg') && y('stg') < y('zrh'), 'north to south: Frankfurt, Stuttgart, Zurich');
@ -518,6 +518,10 @@ test('Stuttgart sits between Frankfurt and Zurich, and Hamburg and Munich are on
assert.ok(y('ham') < y('ber') && y('ham') < y('fra'), 'Hamburg is up north');
assert.equal(ev("CITY.ham.ix"), 'Moin-IX');
assert.equal(ev("NET.lvl.pops.includes('ham')&&NET.dtk.pops.includes('ham')"), true);
assert.ok(x('dus') < x('fra') && x('dus') > x('ams') && y('dus') > y('ams') && y('dus') < y('fra'), 'Düsseldorf: between Amsterdam and Frankfurt');
assert.equal(ev("CITY.dus.ix"), 'Altbier-IX');
assert.ok(ev("kmBetween('dus','ams')") < ev("kmBetween('fra','ams')"), 'closer to Amsterdam than Frankfurt is');
for (const n of ['ntt', 'tly', 'cog', 'drz', 'vdp', 'dtk', 'nfx', 'akm', 'cfl', 'amz', 'msf', 'bdc']) assert.ok(ev(`NET.${n}.pops.includes('dus')`), `${n} is in Düsseldorf, as on PeeringDB`);
assert.deepEqual(errors, []);
});