5f07027faa
Preserve the adapter facade and move adapter-only checks out of domain tests. Late tracks do not reveal an unseen launch origin or its timestamp. Co-Authored-By: Codex GPT-6.1 Terra <noreply@openai.com>
38 lines
1.1 KiB
Rust
38 lines
1.1 KiB
Rust
//! The mod's headless scenarios run against the SDK-independent package too.
|
|
extern crate airdef_core as airdef;
|
|
#[path = "../../airdef-mod/examples/sim_run/harness.rs"]
|
|
mod harness;
|
|
|
|
fn check(sc: harness::Scenario) -> harness::Report {
|
|
let r = harness::run(&sc);
|
|
let problems = r.problems();
|
|
assert!(problems.is_empty(), "scenario {} failed: {problems:?}\n{}", r.name, r.text());
|
|
assert!(r.launched > 0);
|
|
r
|
|
}
|
|
|
|
#[test]
|
|
fn big_smart_raid_on_61_systems() {
|
|
let r = check(harness::big_smart());
|
|
assert_eq!(r.units, 61);
|
|
assert!(r.fired > 0 && r.ground_queries > 0);
|
|
}
|
|
|
|
#[test]
|
|
fn logistics_trucks_depot_and_raid() {
|
|
let r = check(harness::logistics());
|
|
assert!(r.truck_busy_ticks > 0 && r.fired > 0);
|
|
}
|
|
|
|
#[test]
|
|
fn ew_and_adaptive_enemy_over_three_raids() {
|
|
assert_eq!(check(harness::ew_adaptive()).raids_ended, 3);
|
|
}
|
|
|
|
#[test]
|
|
fn same_seed_same_result() {
|
|
let a = harness::run(&harness::logistics());
|
|
let b = harness::run(&harness::logistics());
|
|
assert_eq!((a.ticks_run, a.launched, a.kills, a.hits, a.fired, a.ground_queries), (b.ticks_run, b.launched, b.kills, b.hits, b.fired, b.ground_queries));
|
|
}
|