diff --git a/src/header/mod.rs b/src/header/mod.rs index e822f8d9..aeb44fd3 100644 --- a/src/header/mod.rs +++ b/src/header/mod.rs @@ -658,13 +658,8 @@ mod tests { headers.set(Host { hostname: "foo.bar".to_owned(), port: None }); let s = headers.to_string(); - // hashmap's iterators have arbitrary order, so we must sort first - let mut pieces = s.split("\r\n").collect::>(); - pieces.sort(); - assert_eq!(pieces.len(), 3); - assert_eq!(pieces[0], "Host: foo.bar"); - assert_eq!(pieces[1], "Content-Length: 15"); - assert_eq!(pieces[2], ""); // trailing \r\n + assert!(s.contains("Host: foo.bar\r\n")); + assert!(s.contains("Content-Length: 15\r\n")); } #[test]