mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 20:53:53 +00:00
Add context to compile tests (#7342)
# Objective `bevy_ecs/system_param.rs` contains many seemingly-arbitrary struct definitions which serve as compile tests. ## Solution Add a comment to each one, linking the issue or PR that motivated its addition.
This commit is contained in:
parent
a3baf2ae86
commit
e84907fc55
1 changed files with 9 additions and 1 deletions
|
@ -1481,7 +1481,7 @@ mod tests {
|
|||
system::Query,
|
||||
};
|
||||
|
||||
// Compile test for #2838
|
||||
// Compile test for https://github.com/bevyengine/bevy/pull/2838.
|
||||
#[derive(SystemParam)]
|
||||
pub struct SpecialQuery<
|
||||
'w,
|
||||
|
@ -1492,6 +1492,8 @@ mod tests {
|
|||
_query: Query<'w, 's, Q, F>,
|
||||
}
|
||||
|
||||
// Compile tests for https://github.com/bevyengine/bevy/pull/6694.
|
||||
|
||||
#[derive(SystemParam)]
|
||||
pub struct SpecialRes<'w, T: Resource> {
|
||||
_res: Res<'w, T>,
|
||||
|
@ -1505,9 +1507,11 @@ mod tests {
|
|||
#[derive(Resource)]
|
||||
pub struct R<const I: usize>;
|
||||
|
||||
// Compile test for https://github.com/bevyengine/bevy/pull/7001.
|
||||
#[derive(SystemParam)]
|
||||
pub struct ConstGenericParam<'w, const I: usize>(Res<'w, R<I>>);
|
||||
|
||||
// Compile test for https://github.com/bevyengine/bevy/pull/6867.
|
||||
#[derive(SystemParam)]
|
||||
pub struct LongParam<'w> {
|
||||
_r0: Res<'w, R<0>>,
|
||||
|
@ -1534,6 +1538,7 @@ mod tests {
|
|||
crate::system::assert_is_system(long_system);
|
||||
}
|
||||
|
||||
// Compile test for https://github.com/bevyengine/bevy/pull/6919.
|
||||
#[derive(SystemParam)]
|
||||
struct MyParam<'w, T: Resource, Marker: 'static> {
|
||||
_foo: Res<'w, T>,
|
||||
|
@ -1541,6 +1546,8 @@ mod tests {
|
|||
marker: PhantomData<Marker>,
|
||||
}
|
||||
|
||||
// Compile tests for https://github.com/bevyengine/bevy/pull/6957.
|
||||
|
||||
#[derive(SystemParam)]
|
||||
pub struct UnitParam;
|
||||
|
||||
|
@ -1553,6 +1560,7 @@ mod tests {
|
|||
#[derive(Resource)]
|
||||
struct PrivateResource;
|
||||
|
||||
// Regression test for https://github.com/bevyengine/bevy/issues/4200.
|
||||
#[derive(SystemParam)]
|
||||
pub struct EncapsulatedParam<'w>(Res<'w, PrivateResource>);
|
||||
|
||||
|
|
Loading…
Reference in a new issue