diff --git a/crates/benilla-app/src/target/script.rs b/crates/benilla-app/src/target/script.rs index 82b0d554..bb92fb82 100644 --- a/crates/benilla-app/src/target/script.rs +++ b/crates/benilla-app/src/target/script.rs @@ -113,22 +113,10 @@ impl ScriptSelect<'_, '_> { mod tests { use super::*; - /// The selection calls from Lua, through the binding bodies of ASSISTTARGET (`AssistUnit`) and - /// TARGETLASTHOSTILE (`TargetLastEnemy`): an empty basis, a garbage token and a stale memory - /// are each a no-op (`0x489a40`'s bare `ret`), never a deselect or a panic. - #[test] - fn the_selection_calls_run_assist_and_last_enemy_without_ever_deselecting() { - use crate::net::{Guid, NetCommands, ObjectStore, SelfPlayer}; + /// A world holding what [`ScriptSelect`] reads, with a bare VM and no units. + fn script_world() -> World { + use crate::net::NetCommands; use benilla_ui::script::UiScript; - use bevy::ecs::system::RunSystemOnce; - - const ME: u64 = 1; - const BASIS: u64 = 0xB0A2; - const VICTIM: u64 = 0xC0DE; - const GONE: u64 = 0x6017; - // `UNIT_FIELD_TARGET` is a 2-field guid at index 16; HEALTH/MAXHEALTH keep the units live. - let store = - |pairs: &[(u16, u32)]| ObjectStore(benilla_protocol::ObjectFields::from_pairs(pairs)); let (tx, _rx) = crossbeam_channel::unbounded(); let mut world = World::new(); @@ -148,6 +136,27 @@ mod tests { world.init_resource::(); world.init_resource::