From add93920f603319e9687a2c4f4219b06b2882144 Mon Sep 17 00:00:00 2001 From: hided62 Date: Sun, 26 Jul 2026 22:33:16 +0000 Subject: [PATCH] test live sortie with multiple defenders --- .../turnCommandCoreReference.integration.test.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/integration-tests/test/turnCommandCoreReference.integration.test.ts b/tools/integration-tests/test/turnCommandCoreReference.integration.test.ts index 3bc4a9b..d951ca5 100644 --- a/tools/integration-tests/test/turnCommandCoreReference.integration.test.ts +++ b/tools/integration-tests/test/turnCommandCoreReference.integration.test.ts @@ -77,6 +77,10 @@ integration('core ↔ legacy command-boundary differential', () => { ['nation declaration', 'fixtures/turn-differential/nation-declaration.json'], ['live sortie conquest', 'fixtures/turn-differential/live-sortie-conquest.json'], ['live sortie against a defending general', 'fixtures/turn-differential/live-sortie-defender.json'], + [ + 'live sortie against multiple defending generals', + 'fixtures/turn-differential/live-sortie-multiple-defenders.json', + ], ])( '%s matches command RNG and canonical state delta', async (_label, fixturePath) => { @@ -90,6 +94,17 @@ integration('core ↔ legacy command-boundary differential', () => { request as unknown as Record ); const core = await runCoreTurnCommandTrace(request, reference.before); + if (fixturePath.endsWith('live-sortie-multiple-defenders.json')) { + for (const generalId of [2, 3]) { + const beforeGeneral = reference.before.generals.find((general) => general.id === generalId); + const afterGeneral = reference.after.generals.find((general) => general.id === generalId); + expect(Number(beforeGeneral?.crew)).toBeGreaterThan(0); + expect(Number(afterGeneral?.crew)).toBeLessThan(Number(beforeGeneral?.crew)); + } + const beforeCity = reference.before.cities.find((city) => city.id === 70); + const afterCity = reference.after.cities.find((city) => city.id === 70); + expect(Number(afterCity?.defence)).toBeLessThan(Number(beforeCity?.defence)); + } expect(core.execution.outcome).toMatchObject({ requestedAction: request.action,