update format
This commit is contained in:
parent
6f424f1172
commit
cb37689656
@ -20,7 +20,12 @@ fn de_no_content() {
|
||||
|
||||
let content = "";
|
||||
let loaded: Result<Book, String> = from_str(content);
|
||||
assert_eq!(loaded, Err(String::from("Unexpected end of stream: no root element found")));
|
||||
assert_eq!(
|
||||
loaded,
|
||||
Err(String::from(
|
||||
"Unexpected end of stream: no root element found"
|
||||
))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -34,5 +39,10 @@ fn de_wrong_end_balise() {
|
||||
|
||||
let content = "<book><author>Antoine de Saint-Exupéry<title>Little prince</title></book>";
|
||||
let loaded: Result<Book, String> = from_str(content);
|
||||
assert_eq!(loaded, Err(String::from("Unexpected closing tag: book, expected author")));
|
||||
assert_eq!(
|
||||
loaded,
|
||||
Err(String::from(
|
||||
"Unexpected closing tag: book, expected author"
|
||||
))
|
||||
);
|
||||
}
|
||||
|
||||
@ -99,7 +99,12 @@ fn se_attributes() {
|
||||
}
|
||||
}
|
||||
|
||||
assert_eq!(SubStruct::default(), SubStruct{subitem: "".to_string()});
|
||||
assert_eq!(
|
||||
SubStruct::default(),
|
||||
SubStruct {
|
||||
subitem: "".to_string()
|
||||
}
|
||||
);
|
||||
|
||||
let model = XmlStruct {
|
||||
item: "something".to_string(),
|
||||
@ -138,7 +143,12 @@ fn ser_rename() {
|
||||
}
|
||||
}
|
||||
|
||||
assert_eq!(SubStruct::default(), SubStruct{subitem: "".to_string()});
|
||||
assert_eq!(
|
||||
SubStruct::default(),
|
||||
SubStruct {
|
||||
subitem: "".to_string()
|
||||
}
|
||||
);
|
||||
|
||||
let model = XmlStruct {
|
||||
item: "something".to_string(),
|
||||
@ -180,10 +190,13 @@ fn ser_text_content_with_attributes() {
|
||||
}
|
||||
}
|
||||
|
||||
assert_eq!(SubStruct::default(), SubStruct{
|
||||
subitem: "".to_string(),
|
||||
text: "".to_string(),
|
||||
});
|
||||
assert_eq!(
|
||||
SubStruct::default(),
|
||||
SubStruct {
|
||||
subitem: "".to_string(),
|
||||
text: "".to_string(),
|
||||
}
|
||||
);
|
||||
|
||||
let model = XmlStruct {
|
||||
item: "something".to_string(),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user