Skip to content

Commit 348bcb7

Browse files
authored
tests(derive): Adds test for extendable = "iterator" option. (#119)
1 parent bc41196 commit 348bcb7

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

xmlity-quick-xml/tests/text/extendable.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use xmlity::{Deserialize, Serialize};
66
pub struct ExtendableText(#[xvalue(extendable = true)] String);
77

88
define_test!(
9-
extendable_struct,
9+
extendable_text,
1010
[
1111
(
1212
ExtendableText("BeforeInsideAfter".to_string()),
@@ -16,3 +16,22 @@ define_test!(
1616
(ExtendableText("Text".to_string()), "Text")
1717
]
1818
);
19+
20+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
21+
pub struct ExtendableVec(#[xvalue(extendable = "iterator")] Vec<String>);
22+
23+
define_test!(
24+
extendable_vec,
25+
[
26+
(
27+
ExtendableVec(vec![
28+
"Before".to_string(),
29+
"Inside".to_string(),
30+
"After".to_string()
31+
]),
32+
"BeforeInsideAfter",
33+
"Before<![CDATA[Inside]]>After"
34+
),
35+
(ExtendableVec(vec!["Text".to_string()]), "Text")
36+
]
37+
);

0 commit comments

Comments
 (0)