diff --git a/instant-xml/tests/entities.rs b/instant-xml/tests/entities.rs index 5345098..91c57f6 100644 --- a/instant-xml/tests/entities.rs +++ b/instant-xml/tests/entities.rs @@ -10,61 +10,32 @@ struct StructSpecialEntities<'a> { string: String, str: &'a str, cow: Cow<'a, str>, - vec: Vec, -} - -#[derive(Debug, PartialEq, Eq, FromXml, ToXml)] -#[xml(ns("URI"))] -struct VecEntities<'a> { - complex: Vec>, - list1: Vec, - list2: Vec>, -} - -#[test] -fn vec_entities() { - let serialized = r#"<>&"'adsad"strstr&onetwothreeabab"#; - - let instance = VecEntities { - complex: vec![StructSpecialEntities { - string: String::from("<>&\"'adsad\""), - str: "str", - cow: Cow::Owned("str&".to_string()), - vec: vec!["one".into(), "two".into(), "three".into()], - }], - list1: vec!["a".into(), "b".into()], - list2: vec![vec!["a".into(), "b".into()]], - }; - - assert_eq!(to_string(&instance).unwrap(), serialized); - assert_eq!(from_str(serialized), Ok(instance)); } #[test] fn escape_back() { assert_eq!( from_str( - "<>&"'adsad"strstr&onetwothree" + "<>&"'adsad"strstr&" ), Ok(StructSpecialEntities { string: String::from("<>&\"'adsad\""), str: "str", cow: Cow::Owned("str&".to_string()), - vec: vec!["one".into(), "two".into(), "three".into()] }) ); // Wrong str char assert_eq!( from_str( - "<>&"'adsad"str&onetwothree" + "<>&"'adsad"str&" ), Err::(Error::UnexpectedValue) ); // Borrowed let escape_back = from_str::( - "<>&"'adsad"strstronetwothree" + "<>&"'adsad"strstr" ) .unwrap(); @@ -74,7 +45,7 @@ fn escape_back() { // Owned let escape_back = from_str::( - "<>&"'adsad"strstr&onetwothree" + "<>&"'adsad"strstr&" ) .unwrap(); @@ -90,8 +61,7 @@ fn special_entities() { string: "&\"<>\'aa".to_string(), str: "&\"<>\'bb", cow: Cow::from("&\"<>\'cc"), - vec: vec!["one".into(), "two".into(), "three".into()] }).unwrap(), - "&"<>'aa&"<>'bb&"<>'cconetwothree", + "&"<>'aa&"<>'bb&"<>'cc", ); }