Skip to content

Commit

Permalink
test(boxed_field): Confirm Foo::bar is boxed (#1168)
Browse files Browse the repository at this point in the history
  • Loading branch information
caspermeijn authored Oct 23, 2024
1 parent 67a76c8 commit 9b9f5d3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
10 changes: 10 additions & 0 deletions tests/src/boxed_field.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
include!(concat!(env!("OUT_DIR"), "/boxed_field.rs"));

#[test]
/// Confirm `Foo::bar` is boxed by creating an instance
fn test_bar_is_boxed() {
use alloc::boxed::Box;
let _ = Foo {
bar: Some(Box::new(Bar {})),
};
}
7 changes: 3 additions & 4 deletions tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ mod submessage_without_package;
#[cfg(test)]
mod type_names;

#[cfg(test)]
mod boxed_field;

mod test_enum_named_option_value {
include!(concat!(env!("OUT_DIR"), "/myenum.optionn.rs"));
}
Expand Down Expand Up @@ -140,10 +143,6 @@ pub mod invalid {
}
}

pub mod boxed_field {
include!(concat!(env!("OUT_DIR"), "/boxed_field.rs"));
}

pub mod default_string_escape {
include!(concat!(env!("OUT_DIR"), "/default_string_escape.rs"));
}
Expand Down

0 comments on commit 9b9f5d3

Please sign in to comment.