Skip to main content

Module model

Module model 

Source
Expand description

The test model shared by every stage.

Validated values such as GameDate and Tag come from foch-annotation, which parses them for annotations and editors alike; later stages never re-validate them.

Structs§

CaseIndex
Position of a case in a plan.
Clause
One top-level condition of a condition block. Top-level conditions are conjunctive and side-effect free, so evaluating them separately at the same moment gives the same verdict as the whole block.
ContentId
Stable identity of a case’s executable content: changes when its start, steps, fixtures or AI mode change, but not when lines merely move or marks such as #skip are added.
EventId
123 or namespace.123.
EventInfo
A top-level country_event seen while collecting, used to validate fire targets and to estimate what a case touches.
Fixture
A named, reusable preparation step, executed in the case’s country scope before the case’s own steps. There is no teardown: every session is discarded after it runs.
FixtureName
Name of a fixture: an ASCII identifier.
GameDate
A full EU4 calendar date (no leap years), formatted YYYY.M.D.
HelperFile
A helper event file copied into the generated test layer.
Marker
Marks
NativeBlock
Native script, without its outer braces.
NodeId
Human-readable address of a case, modeled on pytest node IDs: my-mod::events/reforms.txt::reforms.1::grants_flag[tag=DAN].
RunId
Identifies one execution of the test command. It appears in generated script and log markers, so it is restricted to a safe alphabet.
Start
Tag
Three uppercase ASCII letters/digits starting with a letter, such as SWE.
TestCase
XFail

Enums§

AiMode
CaseName
A case’s name within its target. Unnamed inline cases use their position among the annotations on the same event, which shifts when annotations are added or removed.
SessionRequest
Step

Constants§

MAX_ADVANCE_DAYS
Upper bound of real game days a single test may advance in total.

Functions§

identifier
An ASCII identifier: a letter or _, then letters, digits or _.