Skip to content

Commit a894fe6

Browse files
committed
add another test
1 parent 24cec5c commit a894fe6

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

crates/bevy_mod_scripting_core/src/extractors.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,4 +233,22 @@ mod test {
233233
app.finish();
234234
app.update();
235235
}
236+
237+
#[test]
238+
#[should_panic]
239+
pub fn check_with_world_panics_when_not_only_top_level_param() {
240+
let system_fn = |mut guard: WithWorldGuard<(ResMut<Res>, Query<&'static Comp>)>,
241+
_res: ResMut<Res>| {
242+
let (_guard, (_res, _entity)) = guard.get_mut();
243+
};
244+
245+
let mut app = bevy::app::App::new();
246+
app.add_systems(Update, system_fn);
247+
app.insert_resource(Res);
248+
app.world_mut().spawn(Comp);
249+
250+
app.cleanup();
251+
app.finish();
252+
app.update();
253+
}
236254
}

0 commit comments

Comments
 (0)