Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(boxed_field): Confirm Foo::bar is boxed #1168

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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