test(mc-trade): ✅ Add test coverage for new DiplomaticAgreement variants in trade lifecycle simulation
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
f407a321f9
commit
b008299849
1 changed files with 5 additions and 2 deletions
|
|
@ -4,7 +4,7 @@
|
|||
use mc_trade::{
|
||||
advance_relations, break_trades_on_war, evaluate_trades,
|
||||
relation::{pair_key, Relation, RelationState},
|
||||
PlayerTradeInput, TradeLedger,
|
||||
DiplomaticAgreement, PlayerTradeInput, TradeLedger,
|
||||
};
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
|
||||
|
|
@ -43,7 +43,10 @@ fn golden_trade_lifecycle_20_turns() {
|
|||
// T5: trade forms
|
||||
ledger = evaluate_trades(&players, &relations, 5);
|
||||
assert_eq!(ledger.agreements.len(), 1, "T5: expected one trade agreement");
|
||||
let ag = &ledger.agreements[0];
|
||||
let ag = match &ledger.agreements[0] {
|
||||
DiplomaticAgreement::LuxurySwap(ta) => ta,
|
||||
other => panic!("expected LuxurySwap, got {other:?}"),
|
||||
};
|
||||
assert_eq!(ag.partners, (0, 1));
|
||||
// p0 sends silk (alphabetically before "coal" but coal isn't surplus for p1)
|
||||
assert_eq!(ag.gives_a, "silk");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue