test: cover nation research commands
This commit is contained in:
@@ -62,8 +62,8 @@ normalized to the core `*Id` spelling before command identity comparison.
|
||||
The matrix includes the four-call `전투태세` path, lifecycle and
|
||||
appointment commands, troop assembly, rebellion and all three founding
|
||||
variants.
|
||||
- `turnCommandNationMatrix.integration.test.ts`: 8 successful nation
|
||||
command paths.
|
||||
- `turnCommandNationMatrix.integration.test.ts`: 26 successful nation
|
||||
command paths, including all nine unit-research commands.
|
||||
- `turnCommandCoreReference.integration.test.ts`: declaration and live
|
||||
sortie fixtures.
|
||||
|
||||
@@ -168,11 +168,11 @@ Compatibility is established per case only when:
|
||||
4. live sortie also passes the battle trace comparison;
|
||||
5. any ignored path is documented in the case evidence.
|
||||
|
||||
As of 2026-07-25, 54 general matrix cases, 8 nation matrix cases, declaration
|
||||
As of 2026-07-26, 54 general matrix cases, 26 nation matrix cases, declaration
|
||||
and live sortie pass this boundary. Live sortie is the remaining general
|
||||
command key and covers battle entry, conquest, defeated-general neutralization
|
||||
and last-city nation collapse. Thus all 55 general command keys have a
|
||||
completed success-path comparison. This is 64 executable comparison cases;
|
||||
completed success-path comparison. This is 82 executable comparison cases;
|
||||
it is not yet a claim that failure/boundary paths or all 38 nation commands
|
||||
have been dynamically compared.
|
||||
|
||||
|
||||
@@ -137,16 +137,9 @@ export class ActionDefinition<
|
||||
: {};
|
||||
const recvKey = `n${nation.id}`;
|
||||
const priorEntry =
|
||||
typeof recvAssist[recvKey] === 'object' &&
|
||||
recvAssist[recvKey] !== null &&
|
||||
!Array.isArray(recvAssist[recvKey])
|
||||
? recvAssist[recvKey]
|
||||
: {};
|
||||
const priorAmount = Number(priorEntry['1'] ?? 0);
|
||||
recvAssist[recvKey] = {
|
||||
0: nation.id,
|
||||
1: (Number.isFinite(priorAmount) ? priorAmount : 0) + actualGold + actualRice,
|
||||
};
|
||||
typeof recvAssist[recvKey] === 'object' && recvAssist[recvKey] !== null ? recvAssist[recvKey] : {};
|
||||
const priorAmount = Number(Array.isArray(priorEntry) ? priorEntry[1] : (priorEntry['1'] ?? 0));
|
||||
recvAssist[recvKey] = [nation.id, (Number.isFinite(priorAmount) ? priorAmount : 0) + actualGold + actualRice];
|
||||
|
||||
const effects: Array<GeneralActionEffect<TriggerState>> = [
|
||||
createNationPatchEffect(
|
||||
|
||||
@@ -384,7 +384,7 @@ describe('Nation Missing Actions', () => {
|
||||
gold: 200,
|
||||
rice: 150,
|
||||
meta: expect.objectContaining({
|
||||
recv_assist: { n1: { 0: 1, 1: 150 } },
|
||||
recv_assist: { n1: [1, 150] },
|
||||
}),
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -69,6 +69,22 @@ interface FixturePatches {
|
||||
randomFoundingCandidateCityIds?: number[];
|
||||
}
|
||||
|
||||
type NationMatrixCase = [string, Record<string, unknown> | undefined, FixturePatches?];
|
||||
|
||||
const researchCase = (action: string, command: string, term: number): NationMatrixCase => [
|
||||
action,
|
||||
undefined,
|
||||
{
|
||||
nations: {
|
||||
1: {
|
||||
turnLastByOfficerLevel: {
|
||||
12: { command, term },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const buildRequest = (
|
||||
action: string,
|
||||
args?: Record<string, unknown>,
|
||||
@@ -192,7 +208,7 @@ const buildRequest = (
|
||||
},
|
||||
});
|
||||
|
||||
const cases: Array<[string, Record<string, unknown> | undefined, FixturePatches?]> = [
|
||||
const cases: NationMatrixCase[] = [
|
||||
['휴식', undefined],
|
||||
['che_포상', { isGold: true, amount: 100, destGeneralID: 3 }],
|
||||
['che_선전포고', { destNationID: 2 }],
|
||||
@@ -282,6 +298,15 @@ const cases: Array<[string, Record<string, unknown> | undefined, FixturePatches?
|
||||
randomFoundingCandidateCityIds: [70],
|
||||
},
|
||||
],
|
||||
researchCase('event_원융노병연구', '원융노병 연구', 23),
|
||||
researchCase('event_화시병연구', '화시병 연구', 11),
|
||||
researchCase('event_음귀병연구', '음귀병 연구', 11),
|
||||
researchCase('event_대검병연구', '대검병 연구', 11),
|
||||
researchCase('event_화륜차연구', '화륜차 연구', 23),
|
||||
researchCase('event_산저병연구', '산저병 연구', 11),
|
||||
researchCase('event_극병연구', '극병 연구', 23),
|
||||
researchCase('event_상병연구', '상병 연구', 23),
|
||||
researchCase('event_무희연구', '무희 연구', 23),
|
||||
];
|
||||
|
||||
integration('nation command success matrix', () => {
|
||||
|
||||
Reference in New Issue
Block a user