Skip to content

Commit

Permalink
Fix failing test on Windows (#3037)
Browse files Browse the repository at this point in the history
  • Loading branch information
imor committed Jul 2, 2023
1 parent 241da6e commit 4eeb014
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions actix-files/src/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,14 @@ mod tests {

assert_eq!(res.status(), StatusCode::OK);
let body = test::read_body(res).await;
let body_str = std::str::from_utf8(&body).unwrap();
let actual_path = Path::new(&body_str);
let expected_path = Path::new("actix-files/tests");
assert!(
body.ends_with(b"actix-files/tests/"),
"body {:?} does not end with `actix-files/tests/`",
body
actual_path.ends_with(expected_path),
"body {:?} does not end with {:?}",
actual_path,
expected_path
);
}
}

0 comments on commit 4eeb014

Please sign in to comment.