Island Wi-Fi: no new routing fields until you run a zone

emptyR() carried cityWisp, wisp and wispL in every game, so a game with no island zones no longer routed to the same R
as main and tests/route-fuzz.test.js failed on its first move. compute() now adds them only while a zone runs (as
satU), wispMoney() returns without them, and the agent's results docs say so. tests/wisp-zones.test.js checks that a
game without zones, and one below level 2, has none of them. The mp-sim fixtures were written again with
tests/lib/mp-sim-fixtures.js (only the three empty fields left them; a second run changes nothing).
This commit is contained in:
jvanvik 2026-11-12 02:40:09 +01:00
parent 66ac7d0af1
commit 5ca8270db9
8 changed files with 14 additions and 12 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -234,10 +234,11 @@ test('saves: zones and circuits survive a reload, broken ones are repaired, and
assert.equal(ev(`${Z}.d`), d0);
assert.ok(Number.isFinite(ev(`${Z}.d`)));
assert.equal(ev("'wisp' in R.rev||'wisp' in R.cost"), false);
assert.deepEqual(J(ev, 'R.cityWisp'), {});
assert.equal(ev("['cityWisp','wisp','wispL'].some(k=>k in R)"), false, 'and nothing in the routing results');
// An old save has no zones and runs as it did.
ev(`S=migrate(JSON.parse(${JSON.stringify(SAVE)}));compute()`);
assert.equal(ev("Object.values(S.pops).some(p=>'wisp' in p)"), false);
assert.equal(ev("['cityWisp','wisp','wispL'].some(k=>k in R)"), false, 'no zone, no new fields: R is what main routes (tests/route-fuzz.test.js)');
assert.equal(ev("'wisp' in R.cost||'wisp' in R.rev"), false);
assert.ok(ev('R.served') > 0);
assert.deepEqual(errors, []);
@ -269,7 +270,7 @@ test('gates: never in puzzles, the Architect or scenarios, and not below level 2
assert.equal(ev('wispOn()'), false);
assert.doesNotMatch(ev("document.getElementById('panel').textContent"), /Island Wi-Fi/);
assert.equal(ev("wispFact('suv')+wispHtml('suv')"), '');
assert.equal(ev('R.wispL.length'), 0, 'its homes are no demand');
assert.equal(ev("'wispL' in R||'cityWisp' in R"), false, 'its homes are no demand');
assert.match(ev("wispSatWhy('vanualevu','kac1',2)"), /level 2/);
ev("ACT.startScn({id:SCN[0].id})");
assert.equal(ev('!!S.scn&&wispOn()'), false, 'scenarios');