Rip out quick-xml
This commit is contained in:
parent
0fcb8285c5
commit
ea366c2334
15 changed files with 136 additions and 177 deletions
|
|
@ -233,15 +233,15 @@ mod tests {
|
|||
#[cfg(target_pointer_width = "32")]
|
||||
#[test]
|
||||
fn test_size() {
|
||||
assert_size!(IqType, 136);
|
||||
assert_size!(Iq, 228);
|
||||
assert_size!(IqType, 120);
|
||||
assert_size!(Iq, 212);
|
||||
}
|
||||
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
#[test]
|
||||
fn test_size() {
|
||||
assert_size!(IqType, 272);
|
||||
assert_size!(Iq, 456);
|
||||
assert_size!(IqType, 240);
|
||||
assert_size!(Iq, 424);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -689,7 +689,7 @@ mod tests {
|
|||
assert_size!(Senders, 1);
|
||||
assert_size!(Disposition, 1);
|
||||
assert_size!(ContentId, 12);
|
||||
assert_size!(Content, 252);
|
||||
assert_size!(Content, 228);
|
||||
assert_size!(Reason, 1);
|
||||
assert_size!(ReasonElement, 16);
|
||||
assert_size!(SessionId, 12);
|
||||
|
|
@ -704,7 +704,7 @@ mod tests {
|
|||
assert_size!(Senders, 1);
|
||||
assert_size!(Disposition, 1);
|
||||
assert_size!(ContentId, 24);
|
||||
assert_size!(Content, 504);
|
||||
assert_size!(Content, 456);
|
||||
assert_size!(Reason, 1);
|
||||
assert_size!(ReasonElement, 32);
|
||||
assert_size!(SessionId, 24);
|
||||
|
|
|
|||
|
|
@ -110,13 +110,13 @@ mod tests {
|
|||
#[cfg(target_pointer_width = "32")]
|
||||
#[test]
|
||||
fn test_size() {
|
||||
assert_size!(JingleMI, 92);
|
||||
assert_size!(JingleMI, 76);
|
||||
}
|
||||
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
#[test]
|
||||
fn test_size() {
|
||||
assert_size!(JingleMI, 184);
|
||||
assert_size!(JingleMI, 152);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -346,46 +346,46 @@ mod tests {
|
|||
fn serialise() {
|
||||
let elem: Element = Join::from_nick_and_nodes("coucou", &["foo", "bar"]).into();
|
||||
let xml = String::from(&elem);
|
||||
assert_eq!(xml, "<join xmlns=\"urn:xmpp:mix:core:1\"><nick>coucou</nick><subscribe node=\"foo\"/><subscribe node=\"bar\"/></join>");
|
||||
assert_eq!(xml, "<join xmlns='urn:xmpp:mix:core:1'><nick>coucou</nick><subscribe node=\"foo\"/><subscribe node=\"bar\"/></join>");
|
||||
|
||||
let elem: Element = UpdateSubscription::from_nodes(&["foo", "bar"]).into();
|
||||
let xml = String::from(&elem);
|
||||
assert_eq!(xml, "<update-subscription xmlns=\"urn:xmpp:mix:core:1\"><subscribe node=\"foo\"/><subscribe node=\"bar\"/></update-subscription>");
|
||||
assert_eq!(xml, "<update-subscription xmlns='urn:xmpp:mix:core:1'><subscribe node=\"foo\"/><subscribe node=\"bar\"/></update-subscription>");
|
||||
|
||||
let elem: Element = Leave.into();
|
||||
let xml = String::from(&elem);
|
||||
assert_eq!(xml, "<leave xmlns=\"urn:xmpp:mix:core:1\"/>");
|
||||
assert_eq!(xml, "<leave xmlns='urn:xmpp:mix:core:1'/>");
|
||||
|
||||
let elem: Element = SetNick::new("coucou").into();
|
||||
let xml = String::from(&elem);
|
||||
assert_eq!(
|
||||
xml,
|
||||
"<setnick xmlns=\"urn:xmpp:mix:core:1\"><nick>coucou</nick></setnick>"
|
||||
"<setnick xmlns='urn:xmpp:mix:core:1'><nick>coucou</nick></setnick>"
|
||||
);
|
||||
|
||||
let elem: Element = Mix::new("coucou", "coucou@example").into();
|
||||
let xml = String::from(&elem);
|
||||
assert_eq!(
|
||||
xml,
|
||||
"<mix xmlns=\"urn:xmpp:mix:core:1\"><nick>coucou</nick><jid>coucou@example</jid></mix>"
|
||||
"<mix xmlns='urn:xmpp:mix:core:1'><nick>coucou</nick><jid>coucou@example</jid></mix>"
|
||||
);
|
||||
|
||||
let elem: Element = Create::new().into();
|
||||
let xml = String::from(&elem);
|
||||
assert_eq!(xml, "<create xmlns=\"urn:xmpp:mix:core:1\"/>");
|
||||
assert_eq!(xml, "<create xmlns='urn:xmpp:mix:core:1'/>");
|
||||
|
||||
let elem: Element = Create::from_channel_id("coucou").into();
|
||||
let xml = String::from(&elem);
|
||||
assert_eq!(
|
||||
xml,
|
||||
"<create xmlns=\"urn:xmpp:mix:core:1\" channel=\"coucou\"/>"
|
||||
"<create xmlns='urn:xmpp:mix:core:1' channel=\"coucou\"/>"
|
||||
);
|
||||
|
||||
let elem: Element = Destroy::new("coucou").into();
|
||||
let xml = String::from(&elem);
|
||||
assert_eq!(
|
||||
xml,
|
||||
"<destroy xmlns=\"urn:xmpp:mix:core:1\" channel=\"coucou\"/>"
|
||||
"<destroy xmlns='urn:xmpp:mix:core:1' channel=\"coucou\"/>"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -318,7 +318,7 @@ mod tests {
|
|||
fn test_size() {
|
||||
assert_size!(ErrorType, 1);
|
||||
assert_size!(DefinedCondition, 1);
|
||||
assert_size!(StanzaError, 132);
|
||||
assert_size!(StanzaError, 116);
|
||||
}
|
||||
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
|
|
@ -326,7 +326,7 @@ mod tests {
|
|||
fn test_size() {
|
||||
assert_size!(ErrorType, 1);
|
||||
assert_size!(DefinedCondition, 1);
|
||||
assert_size!(StanzaError, 264);
|
||||
assert_size!(StanzaError, 232);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -596,7 +596,7 @@ mod tests {
|
|||
assert_eq!(html, "Hello world!");
|
||||
|
||||
let elem = Element::from(parsed2);
|
||||
assert_eq!(String::from(&elem), "<html xmlns=\"http://jabber.org/protocol/xhtml-im\"><body xmlns=\"http://www.w3.org/1999/xhtml\">Hello world!</body></html>");
|
||||
assert_eq!(String::from(&elem), "<html xmlns='http://jabber.org/protocol/xhtml-im'><body xmlns='http://www.w3.org/1999/xhtml'>Hello world!</body></html>");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Reference in a new issue