From 08ba1640733b6e14a17ef73ea668f5ff3a10b28e Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Mon, 29 May 2017 03:42:11 +0100 Subject: [PATCH] roster: Add a test for empty name == no name. --- src/roster.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/roster.rs b/src/roster.rs index 51e8eb1..e8dd8ad 100644 --- a/src/roster.rs +++ b/src/roster.rs @@ -168,6 +168,10 @@ mod tests { assert_eq!(roster.ver, Some(String::from("ver7"))); assert_eq!(roster.items.len(), 2); + let elem2: Element = "".parse().unwrap(); + let roster2 = Roster::try_from(elem2).unwrap(); + assert_eq!(roster.items, roster2.items); + let elem: Element = "".parse().unwrap(); let roster = Roster::try_from(elem).unwrap(); assert_eq!(roster.ver, Some(String::from("ver9")));