presence, message, jingle_ft: Remove unneeded println!().

This commit is contained in:
Emmanuel Gil Peyrot 2017-04-29 06:57:20 +01:00
parent 61efeb827f
commit 7750aae5b5
3 changed files with 7 additions and 15 deletions

View file

@ -173,7 +173,6 @@ pub fn serialise_file(file: &File) -> Element {
let mut root = Element::builder("file") let mut root = Element::builder("file")
.ns(ns::JINGLE_FT) .ns(ns::JINGLE_FT)
.build(); .build();
println!("{:#?}", file);
if let Some(ref date) = file.date { if let Some(ref date) = file.date {
root.append_child(Element::builder("date") root.append_child(Element::builder("date")
.ns(ns::JINGLE_FT) .ns(ns::JINGLE_FT)

View file

@ -192,31 +192,27 @@ mod tests {
#[test] #[test]
fn test_serialise() { fn test_serialise() {
let elem: Element = "<message xmlns='jabber:client' type='normal'/>".parse().unwrap(); let elem: Element = "<message xmlns='jabber:client' type='normal'/>".parse().unwrap();
let message = message::parse_message(&elem).unwrap(); let message = message::Message {
let message2 = message::Message {
from: None, from: None,
to: None, to: None,
id: None, id: None,
type_: message::MessageType::Normal, type_: message::MessageType::Normal,
payloads: vec!(), payloads: vec!(),
}; };
let elem2 = message::serialise(&message2); let elem2 = message::serialise(&message);
assert_eq!(elem, elem2); assert_eq!(elem, elem2);
println!("{:#?}", message);
} }
#[test] #[test]
fn test_body() { fn test_body() {
let elem: Element = "<message xmlns='jabber:client' to='coucou@example.org' type='chat'><body>Hello world!</body></message>".parse().unwrap(); let elem: Element = "<message xmlns='jabber:client' to='coucou@example.org' type='chat'><body>Hello world!</body></message>".parse().unwrap();
let message = message::parse_message(&elem).unwrap(); message::parse_message(&elem).unwrap();
println!("{:#?}", message);
} }
#[test] #[test]
fn test_serialise_body() { fn test_serialise_body() {
let elem: Element = "<message xmlns='jabber:client' to='coucou@example.org' type='chat'><body>Hello world!</body></message>".parse().unwrap(); let elem: Element = "<message xmlns='jabber:client' to='coucou@example.org' type='chat'><body>Hello world!</body></message>".parse().unwrap();
let message = message::parse_message(&elem).unwrap(); let message = message::Message {
let message2 = message::Message {
from: None, from: None,
to: Some(Jid::from_str("coucou@example.org").unwrap()), to: Some(Jid::from_str("coucou@example.org").unwrap()),
id: None, id: None,
@ -225,9 +221,8 @@ mod tests {
message::MessagePayloadType::Parsed(message::MessagePayload::Body("Hello world!".to_owned())), message::MessagePayloadType::Parsed(message::MessagePayload::Body("Hello world!".to_owned())),
), ),
}; };
let elem2 = message::serialise(&message2); let elem2 = message::serialise(&message);
assert_eq!(elem, elem2); assert_eq!(elem, elem2);
println!("{:#?}", message);
} }
#[test] #[test]

View file

@ -174,16 +174,14 @@ mod tests {
#[test] #[test]
fn test_serialise() { fn test_serialise() {
let elem: Element = "<presence xmlns='jabber:client' type='unavailable'/>".parse().unwrap(); let elem: Element = "<presence xmlns='jabber:client' type='unavailable'/>".parse().unwrap();
let presence = presence::parse_presence(&elem).unwrap(); let presence = presence::Presence {
let presence2 = presence::Presence {
from: None, from: None,
to: None, to: None,
id: None, id: None,
type_: presence::PresenceType::Unavailable, type_: presence::PresenceType::Unavailable,
payloads: vec!(), payloads: vec!(),
}; };
let elem2 = presence::serialise(&presence2); let elem2 = presence::serialise(&presence);
assert_eq!(elem, elem2); assert_eq!(elem, elem2);
println!("{:#?}", presence);
} }
} }