Add more test cases to de_complex_enum(#8)
This commit is contained in:
parent
95f826b41f
commit
a68bbd81b9
@ -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"?>
|
let content = r#"<?xml version="1.0" encoding="utf-8"?>
|
||||||
<base>
|
<base>
|
||||||
<background>
|
<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"?>
|
let content = r#"<?xml version="1.0" encoding="utf-8"?>
|
||||||
<base>
|
<base>
|
||||||
<background>
|
<background>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user