diff --git a/src/version.rs b/src/version.rs index 49b23ad9..cb877336 100644 --- a/src/version.rs +++ b/src/version.rs @@ -82,6 +82,7 @@ impl From for Element { #[cfg(test)] mod tests { use super::*; + use compare_elements::NamespaceAwareCompare; #[test] fn test_simple() { @@ -91,4 +92,17 @@ mod tests { assert_eq!(version.version, String::from("0.3.0")); assert_eq!(version.os, None); } + + #[test] + fn serialisation() { + let version = Version { + name: String::from("xmpp-rs"), + version: String::from("0.3.0"), + os: None, + }; + let elem1 = Element::from(version); + let elem2: Element = "xmpp-rs0.3.0".parse().unwrap(); + println!("{:?}", elem1); + assert!(elem1.compare_to(&elem2)); + } }