Open merc1031 opened 3 months ago
I fetch a more complex config.xml from jenkins, and distilled it down to this test case.
simplified xml test_failing_description.xml
test_failing_description.xml
<?xml version="1.0" encoding="UTF-8"?><project> <description> <br/> Text </description> </project>
test
#[rstest] fn test_failing_description() { #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SimpleProject { pub description: String, } let d: PathBuf = [ env!("CARGO_MANIFEST_DIR"), "test_resources", "jenkins", "xml", "job", "test_failing_description.xml", ] .iter() .collect(); let xml = fs::read_to_string(d).expect("Unable to read file"); let job: SimpleProject = serde_xml_rs::from_str(&xml).unwrap(); println!("{:?}", job); }
error
thread 'jenkins::xml::job::tests::test_failing_description' panicked at src/jenkins/xml/job.rs:766:63: called `Result::unwrap()` on an `Err` value: UnexpectedToken { token: "XmlEvent::Characters(s)", found: "StartElement(br, {\"\": \"\", \"xml\": \"http://www.w3.org/XML/1998/namespace\", \"xmlns\": \"http://www.w3.org/2000/xmlns/\"})" }
I fetch a more complex config.xml from jenkins, and distilled it down to this test case.
simplified xml
test_failing_description.xml
test
error