mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
muc: Add a serialisation test.
This commit is contained in:
parent
5c79960cee
commit
cbef3f6e8d
1 changed files with 5 additions and 0 deletions
|
@ -52,6 +52,7 @@ impl From<Muc> for Element {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
use compare_elements::NamespaceAwareCompare;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_muc_simple() {
|
fn test_muc_simple() {
|
||||||
|
@ -98,7 +99,11 @@ mod tests {
|
||||||
<password>coucou</password>
|
<password>coucou</password>
|
||||||
</x>"
|
</x>"
|
||||||
.parse().unwrap();
|
.parse().unwrap();
|
||||||
|
let elem1 = elem.clone();
|
||||||
let muc = Muc::try_from(elem).unwrap();
|
let muc = Muc::try_from(elem).unwrap();
|
||||||
assert_eq!(muc.password, Some("coucou".to_owned()));
|
assert_eq!(muc.password, Some("coucou".to_owned()));
|
||||||
|
|
||||||
|
let elem2 = Element::from(muc);
|
||||||
|
assert!(elem1.compare_to(&elem2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue