File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -1120,6 +1120,36 @@ bevy_reflect::tests::should_reflect_debug::Test {
11201120 assert_eq ! ( 321 , data. 0 . inner. 0 ) ;
11211121 }
11221122
1123+ #[ test]
1124+ fn should_take_remote_type ( ) {
1125+ mod external_crate {
1126+ #[ derive( Debug , Default , PartialEq , Eq ) ]
1127+ pub struct TheirType {
1128+ pub value : String ,
1129+ }
1130+ }
1131+
1132+ // === Remote Wrapper === //
1133+ #[ reflect_remote( external_crate:: TheirType ) ]
1134+ #[ derive( Debug , Default ) ]
1135+ #[ reflect( Debug , Default ) ]
1136+ struct MyType {
1137+ pub value : String ,
1138+ }
1139+
1140+ let input: Box < dyn Reflect > = Box :: new ( MyType ( external_crate:: TheirType {
1141+ value : "Hello" . to_string ( ) ,
1142+ } ) ) ;
1143+
1144+ let output: MyType = input. take ( ) . expect ( "data should be of type `MyType`" ) ;
1145+ assert_eq ! (
1146+ external_crate:: TheirType {
1147+ value: "Hello" . to_string( ) ,
1148+ } ,
1149+ output. 0
1150+ ) ;
1151+ }
1152+
11231153 #[ cfg( feature = "glam" ) ]
11241154 mod glam {
11251155 use super :: * ;
You can’t perform that action at this time.
0 commit comments