Execute locomotive cost packed event descriptors

This commit is contained in:
Jan Petykiewicz 2026-04-16 11:19:53 -07:00
commit 09039d24e4
18 changed files with 785 additions and 21 deletions

View file

@ -185,6 +185,7 @@ mod tests {
event_runtime_records: Vec::new(),
candidate_availability: BTreeMap::new(),
named_locomotive_availability: BTreeMap::new(),
named_locomotive_cost: BTreeMap::new(),
special_conditions: BTreeMap::new(),
service_state: RuntimeServiceState::default(),
},
@ -357,6 +358,7 @@ mod tests {
event_runtime_records: Vec::new(),
candidate_availability: BTreeMap::new(),
named_locomotive_availability: BTreeMap::new(),
named_locomotive_cost: BTreeMap::new(),
special_conditions: BTreeMap::new(),
service_state: RuntimeServiceState::default(),
},

View file

@ -158,6 +158,8 @@ pub struct ExpectedRuntimeSummary {
#[serde(default)]
pub zero_named_locomotive_availability_count: Option<usize>,
#[serde(default)]
pub named_locomotive_cost_count: Option<usize>,
#[serde(default)]
pub special_condition_count: Option<usize>,
#[serde(default)]
pub enabled_special_condition_count: Option<usize>,
@ -775,6 +777,14 @@ impl ExpectedRuntimeSummary {
));
}
}
if let Some(count) = self.named_locomotive_cost_count {
if actual.named_locomotive_cost_count != count {
mismatches.push(format!(
"named_locomotive_cost_count mismatch: expected {count}, got {}",
actual.named_locomotive_cost_count
));
}
}
if let Some(count) = self.special_condition_count {
if actual.special_condition_count != count {
mismatches.push(format!(