You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
expected = "Transmuted state for (bevy_ecs::entity::Entity, bevy_ecs::query::filter::Changed<bevy_ecs::query::state::tests::B>) attempts to access terms that are not allowed by original state (&bevy_ecs::query::state::tests::A, ())."
1882
+
)]
1883
+
fncannot_transmute_changed_without_access(){
1884
+
letmut world = World::new();
1885
+
world.init_component::<A>();
1886
+
world.init_component::<B>();
1887
+
let query = QueryState::<&A>::new(&mut world);
1888
+
let _new_query = query.transmute_filtered::<Entity,Changed<B>>(&world);
1889
+
1890
+
}
1891
+
1877
1892
#[test]
1878
1893
fnjoin(){
1879
1894
letmut world = World::new();
@@ -1888,4 +1903,28 @@ mod tests {
1888
1903
1889
1904
assert_eq!(new_query.single(&world), entity_ab);
1890
1905
}
1906
+
1907
+
#[test]
1908
+
#[should_panic(
1909
+
expected = "Transmuted state for (&bevy_ecs::query::state::tests::C, ()) attempts to access terms that are not allowed by original state (&bevy_ecs::query::state::tests::A, ())."
1910
+
)]
1911
+
fncannot_join_wrong_fetch(){
1912
+
letmut world = World::new();
1913
+
world.init_component::<C>();
1914
+
let query_1 = QueryState::<&A>::new(&mut world);
1915
+
let query_2 = QueryState::<&B>::new(&mut world);
1916
+
let _query:QueryState<&C> = query_1.join(&world,&query_2);
1917
+
}
1918
+
1919
+
#[test]
1920
+
#[should_panic(
1921
+
expected = "Transmuted state for (bevy_ecs::entity::Entity, bevy_ecs::query::filter::Changed<bevy_ecs::query::state::tests::C>) attempts to access terms that are not allowed by original state (&bevy_ecs::query::state::tests::A, bevy_ecs::query::filter::Without<bevy_ecs::query::state::tests::C>)."
1922
+
)]
1923
+
fncannot_join_wrong_filter(){
1924
+
letmut world = World::new();
1925
+
let query_1 = QueryState::<&A,Without<C>>::new(&mut world);
1926
+
let query_2 = QueryState::<&B,Without<C>>::new(&mut world);
1927
+
let _:QueryState<Entity,Changed<C>> = query_1.join_filtered(&world,&query_2);
0 commit comments