From cbef3f6e8d281218e7da4d6e52ca3a2e103e9fa7 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Mon, 28 May 2018 16:24:17 +0200 Subject: [PATCH] muc: Add a serialisation test. --- src/muc/muc.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/muc/muc.rs b/src/muc/muc.rs index 4a6fda40..5132adbf 100644 --- a/src/muc/muc.rs +++ b/src/muc/muc.rs @@ -52,6 +52,7 @@ impl From for Element { #[cfg(test)] mod tests { use super::*; + use compare_elements::NamespaceAwareCompare; #[test] fn test_muc_simple() { @@ -98,7 +99,11 @@ mod tests { coucou " .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)); } }