Ground bot intentions in live game knowledge and verify outcomes
Core tests / core (push) Successful in 28s
Core tests / core (push) Successful in 28s
This commit is contained in:
@@ -8,3 +8,8 @@ test('resolved old recovery failures do not remain actionable',()=>{const b={id:
|
||||
test('currency formats copper and remains independent of item counts and historical baselines',()=>{const {formatCopper}=require('../.test-build/realm-outcomes.js');assert.equal(formatCopper(12345),'1g 23s 45c');assert.equal(formatCopper(0),'0g 0s 0c');const first=outcomeChanges([{...row,lootedCopper:100}],{at:1,startedAt:1,rows:[row]},2);assert.equal(first.events.length,0);const next=outcomeChanges([{...row,lootedCopper:250}],first.baseline,3);assert.deepEqual(next.events.map(e=>[e.kind,e.amount]),[['lootedCopper',150]]);});
|
||||
|
||||
test('large state chunks preserve Unicode and all history within per-value limits',()=>{const {splitState}=require('../.test-build/state-chunks.js');const input={history:'🎮'.repeat(600000)};const chunks=splitState(input);assert.ok(chunks.length>1);assert.deepEqual(JSON.parse(chunks.join('')),input);for(const c of chunks)assert.ok(Buffer.byteLength(c)<512*1024);});
|
||||
|
||||
test('normal death counts establish a baseline and count subsequent native deaths',()=>{
|
||||
const first=outcomeChanges([{...row,nativeDeaths:100}],{at:1,startedAt:1,rows:[row]},2);assert.equal(first.events.length,0);
|
||||
const next=outcomeChanges([{...row,nativeDeaths:103}],first.baseline,3);assert.equal(next.events.find(e=>e.kind==='nativeDeaths').amount,3);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user