diff --git a/src/sasl.rs b/src/sasl.rs index 05dd250a..86e10760 100644 --- a/src/sasl.rs +++ b/src/sasl.rs @@ -288,4 +288,20 @@ mod tests { String::from("Call 212-555-1212 for assistance.") ); } + + #[test] + fn failure_with_non_prefixed_text_lang() { + let elem: Element = " + + Invalid username or password + " + .parse() + .unwrap(); + let failure = Failure::try_from(elem).unwrap(); + assert_eq!(failure.defined_condition, DefinedCondition::NotAuthorized); + assert_eq!( + failure.texts["en"], + String::from("Invalid username or password") + ); + } }