use mxml_dep::*; #[test] fn parse1() { let mut xml = parse("

a

b

c

").unwrap(); let m = FindMatchEditElement { fme: vec![( FindElement{find:vec![]}, MatchElement{when:vec![Match::HasTag("p".to_string())]}, EditElement{edit:vec![Edit::AddAttribute("a".to_string(),"".to_string())]} ),( FindElement{find:vec![]}, MatchElement{when:vec![Match::HasTag("p".to_string())]}, EditElement{edit:vec![Edit::AddAttribute("b".to_string(),"".to_string())]} )] }; fme(&mut xml, &m); assert_eq!( unparse(&xml), r#"

a

b

c

"# ); } #[test] fn parse2() { let mut xml = parse("

a

b

c

").unwrap(); let m = FindMatchEditElement { fme: vec![( FindElement{find:vec![]}, MatchElement{when:vec![Match::HasAttribute("a".to_string(),"".to_string())]}, EditElement{edit:vec![]}, ),( FindElement{find:vec![]}, MatchElement{when:vec![Match::HasTag("p".to_string())]}, EditElement{edit:vec![Edit::AddAttribute("b".to_string(),"".to_string())]} )] }; fme(&mut xml, &m); assert_eq!( unparse(&xml), r#"

a

b

c

"# ); }