Skip to content

Commit

Permalink
add new test for issue 785
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaspleyer committed Jul 15, 2024
1 parent 10ddcb7 commit 947517f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/serde-issues.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,3 +494,20 @@ fn issue683() {
}
);
}

#[test]
fn issue785() {
#[derive(Debug, Deserialize, Eq, PartialEq, Serialize)]
struct Identifier {
parent: Option<u64>,
}
let ident = Identifier {
parent: None,
};
let mut save_string = String::new();
let mut serializer = quick_xml::se::Serializer::new(&mut save_string);
serializer.indent(' ', 4);
ident.serialize(serializer).unwrap();
let res: Identifier = quick_xml::de::from_str(&save_string).unwrap();
assert_eq!(res, ident);
}

0 comments on commit 947517f

Please sign in to comment.