Add more test cases to de_complex_enum(#8)

This commit is contained in:
superuzir 2019-12-31 13:25:04 +07:00
parent 95f826b41f
commit a68bbd81b9

View File

@ -416,6 +416,21 @@ fn de_complex_enum() {
}
);
let content = r#"<?xml version="1.0" encoding="utf-8"?>
<base>
<background>
<Red>56</Red>
</background>
</base>
"#;
convert_and_validate!(
content,
XmlStruct,
XmlStruct {
background: Color::Red(56),
}
);
let content = r#"<?xml version="1.0" encoding="utf-8"?>
<base>
<background>
@ -434,6 +449,21 @@ fn de_complex_enum() {
}
);
let content = r#"<?xml version="1.0" encoding="utf-8"?>
<base>
<background>
<Yellow>text</Yellow>
</background>
</base>
"#;
convert_and_validate!(
content,
XmlStruct,
XmlStruct {
background: Color::Yellow(Some(String::from("text"))),
}
);
let content = r#"<?xml version="1.0" encoding="utf-8"?>
<base>
<background>