const test = require('node:test'); const assert = require('node:assert/strict'); const { load } = require('./harness'); // Work done once when a game loads (the possible-diversity map, link curves, the map's sea and hills) has shortcuts; // each must give exactly what the plain version gives. test('land test: the bounding box shortcut agrees with walking every coastline', (t) => { const { ev, dom, errors } = load(); t.after(() => dom.window.close()); const bad = ev(`(()=>{const plain=(x,y,pts)=>{let ins=false;for(let i=0,j=pts.length-1;iy)!==(yj>y))&&(x<(xj-xi)*(y-yi)/(yj-yi)+xi))ins=!ins;}return ins;}; let bad=0;for(let x=0;x