mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
presence, message, jingle_ft: Remove unneeded println!().
This commit is contained in:
parent
61efeb827f
commit
7750aae5b5
3 changed files with 7 additions and 15 deletions
|
@ -173,7 +173,6 @@ pub fn serialise_file(file: &File) -> Element {
|
|||
let mut root = Element::builder("file")
|
||||
.ns(ns::JINGLE_FT)
|
||||
.build();
|
||||
println!("{:#?}", file);
|
||||
if let Some(ref date) = file.date {
|
||||
root.append_child(Element::builder("date")
|
||||
.ns(ns::JINGLE_FT)
|
||||
|
|
|
@ -192,31 +192,27 @@ mod tests {
|
|||
#[test]
|
||||
fn test_serialise() {
|
||||
let elem: Element = "<message xmlns='jabber:client' type='normal'/>".parse().unwrap();
|
||||
let message = message::parse_message(&elem).unwrap();
|
||||
let message2 = message::Message {
|
||||
let message = message::Message {
|
||||
from: None,
|
||||
to: None,
|
||||
id: None,
|
||||
type_: message::MessageType::Normal,
|
||||
payloads: vec!(),
|
||||
};
|
||||
let elem2 = message::serialise(&message2);
|
||||
let elem2 = message::serialise(&message);
|
||||
assert_eq!(elem, elem2);
|
||||
println!("{:#?}", message);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_body() {
|
||||
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();
|
||||
println!("{:#?}", message);
|
||||
message::parse_message(&elem).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
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 message = message::parse_message(&elem).unwrap();
|
||||
let message2 = message::Message {
|
||||
let message = message::Message {
|
||||
from: None,
|
||||
to: Some(Jid::from_str("coucou@example.org").unwrap()),
|
||||
id: None,
|
||||
|
@ -225,9 +221,8 @@ mod tests {
|
|||
message::MessagePayloadType::Parsed(message::MessagePayload::Body("Hello world!".to_owned())),
|
||||
),
|
||||
};
|
||||
let elem2 = message::serialise(&message2);
|
||||
let elem2 = message::serialise(&message);
|
||||
assert_eq!(elem, elem2);
|
||||
println!("{:#?}", message);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -174,16 +174,14 @@ mod tests {
|
|||
#[test]
|
||||
fn test_serialise() {
|
||||
let elem: Element = "<presence xmlns='jabber:client' type='unavailable'/>".parse().unwrap();
|
||||
let presence = presence::parse_presence(&elem).unwrap();
|
||||
let presence2 = presence::Presence {
|
||||
let presence = presence::Presence {
|
||||
from: None,
|
||||
to: None,
|
||||
id: None,
|
||||
type_: presence::PresenceType::Unavailable,
|
||||
payloads: vec!(),
|
||||
};
|
||||
let elem2 = presence::serialise(&presence2);
|
||||
let elem2 = presence::serialise(&presence);
|
||||
assert_eq!(elem, elem2);
|
||||
println!("{:#?}", presence);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue