From 41ce927cf3e08c966e9398cbeb244227b6472688 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 7 May 2024 08:50:15 +0200 Subject: [PATCH] test: add another test with various field combinations This tests build for various combinations of different types, in particular some involving cloned types in containers like Vec and Option. --- tests/many_fields.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/many_fields.rs diff --git a/tests/many_fields.rs b/tests/many_fields.rs new file mode 100644 index 0000000..f1c0731 --- /dev/null +++ b/tests/many_fields.rs @@ -0,0 +1,27 @@ +#[macro_use] +extern crate derive_into_owned; + +use std::borrow::Cow; + +#[allow(dead_code, clippy::redundant_allocation)] +#[derive(IntoOwned, Borrowed)] +struct TestTypes<'a> { + a: Box>, + b: Box, + c: Option, + d: Vec, + e: Option>, + f: Option>>, + g: Box>, + h: String, + i: (String, String), + j: (), + k: Option<(i32, String)>, + l: Option<(i32, Vec, Cow<'a, str>)>, + m: Box<(i32, String, Vec>)>, + n: Vec<(i32, Option, Option>)>, + o: ((), ()), + p: (String, (String, (String, String))), + #[allow(clippy::type_complexity)] + q: (String, (String, (String, Box>))), +}