Skip to content

Commit d17ea00

Browse files
committed
Add test for remote reflecting an actual external type
1 parent c1496d2 commit d17ea00

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

crates/bevy_reflect/src/lib.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2845,6 +2845,26 @@ bevy_reflect::tests::Test {
28452845
);
28462846
}
28472847

2848+
#[test]
2849+
fn should_reflect_external_crate_type() {
2850+
// This test relies on the external type not implementing `Reflect`,
2851+
// so let's just double-check that it does not
2852+
assert_not_impl_all!(std::collections::Bound<i32>: Reflect);
2853+
2854+
#[reflect_remote(std::collections::Bound<T>)]
2855+
enum MyBound<T> {
2856+
Included(T),
2857+
Excluded(T),
2858+
Unbounded,
2859+
}
2860+
2861+
#[derive(Reflect)]
2862+
struct MyType {
2863+
#[reflect(remote = MyBound<String>)]
2864+
bound: std::collections::Bound<String>,
2865+
}
2866+
}
2867+
28482868
#[cfg(feature = "glam")]
28492869
mod glam {
28502870
use super::*;

0 commit comments

Comments
 (0)