Skip to content

Commit

Permalink
update format
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcAntoine-Arnaud committed May 24, 2018
1 parent 6f424f1 commit cb37689
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
14 changes: 12 additions & 2 deletions yaserde/tests/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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"
))
);
}
25 changes: 19 additions & 6 deletions yaserde/tests/serializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit cb37689

Please sign in to comment.