diff --git a/instant-xml/tests/transparent.rs b/instant-xml/tests/transparent.rs index bd4f364..a703ad6 100644 --- a/instant-xml/tests/transparent.rs +++ b/instant-xml/tests/transparent.rs @@ -1,4 +1,6 @@ -use instant_xml::{from_str, to_string, FromXml, ToXml}; +use similar_asserts::assert_eq; + +use instant_xml::{from_str, to_string, Error, FromXml, ToXml}; #[derive(Debug, Eq, FromXml, PartialEq, ToXml)] struct Wrapper { @@ -36,4 +38,10 @@ fn inline() { let xml = r#"42hello"#; assert_eq!(xml, to_string(&v).unwrap()); assert_eq!(v, from_str(xml).unwrap()); + + assert_eq!( + from_str::("42hello") + .unwrap_err(), + Error::MissingValue("Inline::bar") + ); }