Punch up the random network names

Swap the real PTT Telecom for Post, Telegraph & Tubes, make the carrier
pigeon an RFC 1149 one, drop the names without a twist and add a batch of
networking puns. Adds a test for the name picker.
This commit is contained in:
Frederic Jung 2026-10-24 21:35:29 +02:00
parent 3009ad8385
commit ceaf4dbb93
No known key found for this signature in database
3 changed files with 27 additions and 8 deletions

View file

@ -168,3 +168,20 @@ test('RouteScript: parses safely, reports errors helpfully, and changes routing'
assert.equal(ev("S.te.script"), '');
assert.deepEqual(errors, []);
});
test('#27 new networks get a random name, and "Another one" never repeats it', () => {
const { ev, errors } = load();
assert.ok(ev("NETWORK_NAMES.every(n=>n.length<=24)&&new Set(NETWORK_NAMES).size===NETWORK_NAMES.length"));
const first = ev("document.getElementById('nmIn').value");
assert.ok(ev(`NETWORK_NAMES.includes(${JSON.stringify(first)})`));
let prev = first;
for (let i = 0; i < 40; i++) {
ev("ACT.randomName()");
const now = ev("document.getElementById('nmIn').value");
assert.notEqual(now, prev);
prev = now;
}
ev("document.getElementById('nmIn').value='My Own Net';ACT.start({})");
assert.equal(ev("S.name"), 'My Own Net');
assert.deepEqual(errors, []);
});