muc: Add a serialisation test.

This commit is contained in:
Emmanuel Gil Peyrot 2018-05-28 16:24:17 +02:00
parent 5c79960cee
commit cbef3f6e8d

View file

@ -52,6 +52,7 @@ impl From<Muc> for Element {
#[cfg(test)]
mod tests {
use super::*;
use compare_elements::NamespaceAwareCompare;
#[test]
fn test_muc_simple() {
@ -98,7 +99,11 @@ mod tests {
<password>coucou</password>
</x>"
.parse().unwrap();
let elem1 = elem.clone();
let muc = Muc::try_from(elem).unwrap();
assert_eq!(muc.password, Some("coucou".to_owned()));
let elem2 = Element::from(muc);
assert!(elem1.compare_to(&elem2));
}
}