use xot::{ParseError, Xot}; #[test] fn test_attribute_parser_order_is_serialization_order1() { let mut xot = Xot::new(); let text = r#""#; let doc = xot.parse(text).unwrap(); assert_eq!(xot.to_string(doc).unwrap(), text); } #[test] fn test_attribute_parser_order_is_serialization_order2() { let mut xot = Xot::new(); let text = r#""#; let doc = xot.parse(text).unwrap(); assert_eq!(xot.to_string(doc).unwrap(), text); } #[test] fn test_attribute_insert_order_is_serialization_order1() { let mut xot = Xot::new(); let c = xot.add_name("c"); let text = r#""#; let doc = xot.parse(text).unwrap(); let doc_el = xot.document_element(doc).unwrap(); let mut attributes = xot.attributes_mut(doc_el); attributes.insert(c, "C".to_string()); assert_eq!(xot.to_string(doc).unwrap(), r#""#); } #[test] fn test_prefix_parser_order_is_serialization_order1() -> Result<(), ParseError> { let mut xot = Xot::new(); let text = r#""#; let doc = xot.parse(text).unwrap(); assert_eq!(xot.to_string(doc).unwrap(), text); Ok(()) } #[test] fn test_prefix_parser_order_is_serialization_order2() { let mut xot = Xot::new(); let text = r#""#; let doc = xot.parse(text).unwrap(); assert_eq!(xot.to_string(doc).unwrap(), text); } #[test] fn test_atribute_reorder() { let mut xot = Xot::new(); let original_xml = r#""#; let root = xot.parse(original_xml).unwrap(); assert_eq!(original_xml, xot.to_string(root).unwrap()); }