Allow Richese reveals with unrelated public deals
Verify and publish checkpoint container / container (push) Successful in 11m19s
Verify and publish checkpoint container / container (push) Successful in 11m19s
This commit is contained in:
1 parent
d7d0f89625
commit
d169740adf
7 files changed
+275
-3
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { createGame, newPlayer, type Decision, type Game } from '../game/engine';
|
||||
import { createPublicDeal, respondPublicDeal } from '../game/public-deals';
|
||||
import { richeseRevealInterruptSupported as supported } from '../game/richese-reveal-interruption';
|
||||
|
||||
/** Staged parent records test only the admission quote; native parent and
|
||||
@@ -185,5 +186,21 @@ void test('live current-turn commitments block the interruption; settled and pre
|
||||
game.futureBattleLeaderPromises = [{turn:game.turn, asker:'r', player:'e', leader:'leader', answer:true, status:'waiting'}];
|
||||
assert.equal(supported(game), false);
|
||||
game.futureBattleLeaderPromises[0].status = 'settled'; assert.equal(supported(game), true);
|
||||
game.deals = [{status:'active'}] as unknown as Game['deals']; assert.equal(supported(game), false);
|
||||
game.travelPromises = [{turn:game.turn, player:'r', asker:'e', answer:true, fulfilled:false, released:false}] as unknown as Game['travelPromises'];
|
||||
assert.equal(supported(game), false);
|
||||
game.travelPromises![0].turn++; assert.equal(supported(game), true);
|
||||
});
|
||||
|
||||
void test('active text and deferred-payment deals do not independently block a clean reveal opportunity', () => {
|
||||
const game = parent('auctionPayment');
|
||||
const text = createPublicDeal(game.players, 'r', 'c', 'A public agreement.', game.turn, 'text');
|
||||
const current = createPublicDeal(game.players, 'c', 'e', 'Pay this turn.', game.turn, 'current',
|
||||
{kind:'deferredBribe', payer:'c', recipient:'e', amount:1, dueTurn:game.turn});
|
||||
const future = createPublicDeal(game.players, 'r', 'e', 'Pay later.', game.turn, 'future',
|
||||
{kind:'deferredBribe', payer:'r', recipient:'e', amount:2, dueTurn:game.turn + 1});
|
||||
game.deals = [respondPublicDeal(text, game.players, 'c', true),
|
||||
respondPublicDeal(current, game.players, 'e', true), respondPublicDeal(future, game.players, 'e', true)];
|
||||
const before = structuredClone(game);
|
||||
assert.equal(supported(game), true);
|
||||
assert.deepEqual(game, before, 'The admission quote must not mutate the deals or parent.');
|
||||
});
|
||||
Reference in new issue
Block a user