Introduce comparing with namespace support.

This commit is contained in:
Astro 2017-08-19 00:04:18 +01:00
commit 1b1661fd82
16 changed files with 156 additions and 20 deletions

View file

@ -340,6 +340,7 @@ impl From<Presence> for Element {
#[cfg(test)]
mod tests {
use super::*;
use compare_elements::NamespaceAwareCompare;
#[test]
fn test_simple() {
@ -363,7 +364,7 @@ mod tests {
let elem: Element = "<presence xmlns='jabber:component:accept' type='unavailable'/>/>".parse().unwrap();
let presence = Presence::new(Type::Unavailable);
let elem2 = presence.into();
assert_eq!(elem, elem2);
assert!(elem.compare_to(&elem2));
}
#[test]