Every transport piece moves material at belt speed and capacity (t105)
This commit is contained in:
@@ -67,6 +67,21 @@ function hash() {
|
||||
run('const forwardChunks=runChunks;runChunks=(chunks,pass,work)=>forwardChunks(chunks.slice().reverse(),pass,work);for(let k=0;k<320;k++)simTick();runChunks=forwardChunks;');
|
||||
assert.strictEqual(hash(),expected,'chunk order within a colour must not matter');
|
||||
console.log('PASS reversing chunks within every pass preserves all bytes and effects');
|
||||
run(require('fs').readFileSync('test/fixtures/t105-transport.js','utf8'));
|
||||
let chainExpected;
|
||||
for(const n of [0,1,2,8]) {
|
||||
flatWorld(run,320,256,240);
|
||||
run(`WS=456;resetWeather();seen.fill(0);ledger={};EV.length=0;
|
||||
for(const k of Object.keys(stats))stats[k]=0;resetEconomy();
|
||||
globalThis.ts=transportChainFixture();`);
|
||||
const stop=n?await enableThreads(run,n):null;
|
||||
try {
|
||||
run('for(let k=0;k<1000;k++){transportFeed(ts,16);simTick();transportCollect(ts);}');
|
||||
const actual=hash();if(!chainExpected)chainExpected=actual;
|
||||
assert.strictEqual(actual,chainExpected,`mixed transport chain differs with ${n} workers`);
|
||||
console.log(`PASS mixed transport chain is identical with ${n} workers (${actual.slice(0,16)})`);
|
||||
} finally {if(stop)await stop();}
|
||||
}
|
||||
const {execFileSync}=require('child_process');
|
||||
const fallback=execFileSync(process.execPath,['-e',`
|
||||
global.SharedArrayBuffer=undefined;
|
||||
|
||||
Reference in New Issue
Block a user