mod common; use common::init_logger; #[cfg(feature = "log")] use log::info; use serde::Deserialize; use serde_xml_rs::from_str; #[derive(Debug, Deserialize, PartialEq)] struct Item { name: String, source: String, } #[test] fn simple_struct_from_attributes_should_fail() { init_logger(); let s = r##" = from_str(s); match item { Ok(_) => assert!(false), Err(e) => { #[cfg(feature = "log")] info!("simple_struct_from_attributes_should_fail(): {}", e); assert!(true) } } } #[test] fn multiple_roots_attributes_should_fail() { init_logger(); let s = r##" "##; let item: Result, _> = from_str(s); match item { Ok(_) => assert!(false), Err(e) => { #[cfg(feature = "log")] info!("multiple_roots_attributes_should_fail(): {}", e); assert!(true) } } }