//! Fixed headless scenarios on the native simulation: no NaN, the raid ends, no stuck jobs. //! Run: `cargo test --test scenarios` (also `cargo run --release --example sim_run -- --help`). #[path = "../examples/sim_run/harness.rs"] mod harness; fn check(sc: harness::Scenario) -> harness::Report { let r = harness::run(&sc); eprintln!("{}", r.text()); let problems = r.problems(); assert!(problems.is_empty(), "scenario {} failed: {problems:?}\n{}", r.name, r.text()); assert!(r.launched > 0, "nothing was launched"); r } #[test] fn big_smart_raid_on_61_systems() { let r = check(harness::big_smart()); assert_eq!(r.units, 61); assert!(r.fired > 0, "air defence never fired"); assert!(r.ground_queries > 0); } #[test] fn logistics_trucks_depot_and_raid() { let r = check(harness::logistics()); assert!(r.truck_busy_ticks > 0, "the trucks never had a job"); assert!(r.fired > 0, "air defence never fired"); } #[test] fn ew_and_adaptive_enemy_over_three_raids() { let r = check(harness::ew_adaptive()); assert_eq!(r.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)); }