From 4eeb01415c05e6136ae0f17ac7f45160c907ad68 Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Sun, 2 Jul 2023 06:06:06 +0530 Subject: [PATCH] Fix failing test on Windows (#3037) --- actix-files/src/files.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/actix-files/src/files.rs b/actix-files/src/files.rs index be2a450d2..4a259d233 100644 --- a/actix-files/src/files.rs +++ b/actix-files/src/files.rs @@ -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 ); } }