From 8d246975d7d0d3bdda255359daa228b07370c926 Mon Sep 17 00:00:00 2001 From: Paul Fariello Date: Thu, 5 Dec 2019 22:36:45 +0100 Subject: [PATCH] Add serialization test for sm failed element --- xmpp-parsers/src/sm.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/xmpp-parsers/src/sm.rs b/xmpp-parsers/src/sm.rs index d84b188..e32cd83 100644 --- a/xmpp-parsers/src/sm.rs +++ b/xmpp-parsers/src/sm.rs @@ -227,6 +227,21 @@ mod tests { #[test] fn test_serialize_failed() { - assert!(false); + let reference: Element = "" + .parse() + .unwrap(); + + let elem: Element = "" + .parse() + .unwrap(); + + let error = DefinedCondition::try_from(elem).unwrap(); + + let failed = Failed { + h: None, + error: Some(error), + }; + let serialized: Element = failed.into(); + assert_eq!(serialized, reference); } }