minidom: Implement PartialEq manually for Node and Element
Move the NamespaceAwareCompare implementation from xmpp-parsers as Node and Element's PartialEq implementation. Thanks Astro! It's a lot more useful in tests to use `assert_eq!` than `assert!`, so we get both items compared (left and right) instead of a "it failed." message. This "breaks" comparison for these two structs in the sense that it is not strict object comparison anymore but it ensures that namespaces are all present in the compared objects. Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
ea6e7c24a3
commit
1c5551a917
20 changed files with 65 additions and 172 deletions
|
|
@ -335,7 +335,6 @@ impl From<Presence> for Element {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::util::compare_elements::NamespaceAwareCompare;
|
||||
use jid::{BareJid, FullJid};
|
||||
|
||||
#[cfg(target_pointer_width = "32")]
|
||||
|
|
@ -382,7 +381,7 @@ mod tests {
|
|||
.unwrap();
|
||||
let presence = Presence::new(Type::Unavailable);
|
||||
let elem2 = presence.into();
|
||||
assert!(elem.compare_to(&elem2));
|
||||
assert_eq!(elem, elem2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Reference in a new issue