This commit is contained in:
Paul Fariello 2019-12-30 07:35:32 +01:40 committed by Paul Fariello
parent 8d246975d7
commit 34a87e22a8
6 changed files with 27 additions and 31 deletions

View file

@ -137,7 +137,7 @@ mod tests {
let forwarded = Forwarded::try_from(elem).unwrap();
let received = Received {
forwarded: forwarded,
forwarded: forwarded,
};
let serialized: Element = received.into();
@ -156,7 +156,7 @@ mod tests {
let forwarded = Forwarded::try_from(elem).unwrap();
let sent = Sent {
forwarded: forwarded,
forwarded: forwarded,
};
let serialized: Element = sent.into();

View file

@ -83,14 +83,15 @@ mod tests {
.unwrap();
let message = Message::try_from(elem).unwrap();
let elem: Element = "<delay xmlns='urn:xmpp:delay' from='capulet.com' stamp='2002-09-10T23:08:25Z'/>"
.parse()
.unwrap();
let elem: Element =
"<delay xmlns='urn:xmpp:delay' from='capulet.com' stamp='2002-09-10T23:08:25Z'/>"
.parse()
.unwrap();
let delay = Delay::try_from(elem).unwrap();
let forwarded = Forwarded {
delay: Some(delay),
stanza: Some(message)
stanza: Some(message),
};
let serialized: Element = forwarded.into();

View file

@ -426,9 +426,9 @@ mod tests {
let forwarded = Forwarded::try_from(elem).unwrap();
let result = Result_ {
id: String::from("28482-98726-73623"),
queryid: Some(QueryId(String::from("f27"))),
forwarded: forwarded,
id: String::from("28482-98726-73623"),
queryid: Some(QueryId(String::from("f27"))),
forwarded: forwarded,
};
let serialized: Element = result.into();
assert_eq!(serialized, reference);
@ -447,8 +447,8 @@ mod tests {
let set = SetResult::try_from(elem).unwrap();
let fin = Fin {
set: set,
complete: Complete::default(),
set: set,
complete: Complete::default(),
};
let serialized: Element = fin.into();
assert_eq!(serialized, reference);

View file

@ -695,18 +695,19 @@ mod tests {
.unwrap();
let elem: Element = "<actor xmlns='http://jabber.org/protocol/muc#user' nick='foobar'/>"
.parse()
.unwrap();
.parse()
.unwrap();
let actor = Actor::try_from(elem).unwrap();
let elem: Element = "<continue xmlns='http://jabber.org/protocol/muc#user' thread='foobar'/>"
.parse()
.unwrap();
let elem: Element =
"<continue xmlns='http://jabber.org/protocol/muc#user' thread='foobar'/>"
.parse()
.unwrap();
let continue_ = Continue::try_from(elem).unwrap();
let elem: Element = "<reason xmlns='http://jabber.org/protocol/muc#user'>foobar</reason>"
.parse()
.unwrap();
.parse()
.unwrap();
let reason = Reason::try_from(elem).unwrap();
let item = Item {

View file

@ -698,9 +698,7 @@ mod tests {
.parse()
.unwrap();
let elem: Element = "<x xmlns='jabber:x:data' type='submit'/>"
.parse()
.unwrap();
let elem: Element = "<x xmlns='jabber:x:data' type='submit'/>".parse().unwrap();
let form = DataForm::try_from(elem).unwrap();
@ -720,15 +718,11 @@ mod tests {
.parse()
.unwrap();
let elem: Element = "<x xmlns='jabber:x:data' type='submit'/>"
.parse()
.unwrap();
let elem: Element = "<x xmlns='jabber:x:data' type='submit'/>".parse().unwrap();
let form = DataForm::try_from(elem).unwrap();
let options = PublishOptions {
form: Some(form),
};
let options = PublishOptions { form: Some(form) };
let serialized: Element = options.into();
assert_eq!(serialized, reference);
}

View file

@ -232,14 +232,14 @@ mod tests {
.unwrap();
let elem: Element = "<unexpected-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>"
.parse()
.unwrap();
.parse()
.unwrap();
let error = DefinedCondition::try_from(elem).unwrap();
let failed = Failed {
h: None,
error: Some(error),
h: None,
error: Some(error),
};
let serialized: Element = failed.into();
assert_eq!(serialized, reference);