ping: Add a serialise test.

This commit is contained in:
Emmanuel Gil Peyrot 2017-10-31 17:57:49 +00:00
parent b5e41a7074
commit ed53f452c3

View file

@ -25,6 +25,13 @@ mod tests {
Ping::try_from(elem).unwrap();
}
#[test]
fn test_serialise() {
let elem1 = Element::from(Ping);
let elem2: Element = "<ping xmlns='urn:xmpp:ping'/>".parse().unwrap();
assert_eq!(elem1, elem2);
}
#[test]
fn test_invalid() {
let elem: Element = "<ping xmlns='urn:xmpp:ping'><coucou/></ping>".parse().unwrap();