tor-dirclient: Extend format test to check the body is formatted too (fmt)

This commit is contained in:
Gabriela Moldovan 2023-08-14 11:19:51 +01:00
parent 966150f9b2
commit 6625b2c55f
No known key found for this signature in database
GPG Key ID: 3946E0ADE72BAC99
1 changed files with 4 additions and 1 deletions

View File

@ -61,7 +61,10 @@ mod test {
fn format() {
fn chk_format<B: StringBody + Clone>(body: B, expected_body: &str) {
let req = build_request(body.clone(), &[]);
assert_eq!(encode_request(&req), format!("GET /index.html HTTP/1.0\r\n\r\n{expected_body}"));
assert_eq!(
encode_request(&req),
format!("GET /index.html HTTP/1.0\r\n\r\n{expected_body}")
);
let req = build_request(body, &[("X-Marsupial", "Opossum")]);
assert_eq!(