use rstest::rstest; use xot::Xot; type RoundTripEntry = (&'static str, &'static str); #[rstest] fn roundtrip(#[values( ("basic", r#"12"#), ("self closing", r#""#), ( "namespace prefix", r#"12"#, ), ( "some prefixed", r#"12"#, ), ( "default namespace", r#"12"#, ), ( "prefix shadowing", r#""#, ), ( "attribute", r#""#, ), ( "attribute in namespace", r#""#, ), ( "escape character in text", r#"<a/&"#, ), ( "gt is escaped by default", r#">'""#, ), ( "comment", r#""#, ), ( "processing instruction without data", r#""#, ), ( "processing instruction with data", r#""#, ), ( "xml prefix supported", r#""#, ), ( "attribute stability", r#""#, ), ( "attribute stability given xml namespace", r#""#, ), ( "prefix stability", r#""#, ) )] value: RoundTripEntry) { let (name, xml) = value; let mut xot = Xot::new(); let doc = xot.parse(xml).unwrap(); let output_xml = xot.to_string(doc).unwrap(); assert_eq!(xml, &output_xml, "roundtrip failed for: {}", name); }