Skip to content

Commit

Permalink
Add test for remote reflecting an actual external type
Browse files Browse the repository at this point in the history
  • Loading branch information
MrGVSV committed Aug 12, 2024
1 parent 39f9b00 commit ef97631
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions crates/bevy_reflect/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2749,6 +2749,26 @@ bevy_reflect::tests::Test {
);
}

#[test]
fn should_reflect_external_crate_type() {
// This test relies on the external type not implementing `Reflect`,
// so let's just double-check that it does not
assert_not_impl_all!(std::collections::Bound<i32>: Reflect);

#[reflect_remote(std::collections::Bound<T>)]
enum MyBound<T> {
Included(T),
Excluded(T),
Unbounded,
}

#[derive(Reflect)]
struct MyType {
#[reflect(remote = MyBound<String>)]
bound: std::collections::Bound<String>,
}
}

#[cfg(feature = "glam")]
mod glam {
use super::*;
Expand Down

0 comments on commit ef97631

Please sign in to comment.