From 9f88963764ad2e02836b6583ac556503b4f3c687 Mon Sep 17 00:00:00 2001 From: Anup Mahindre Date: Sat, 22 May 2021 14:51:50 +0530 Subject: [PATCH] tests: fix test_ls_path for windows --- tests/by-util/test_ls.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/by-util/test_ls.rs b/tests/by-util/test_ls.rs index fc4051039..6d6c65194 100644 --- a/tests/by-util/test_ls.rs +++ b/tests/by-util/test_ls.rs @@ -1992,10 +1992,18 @@ fn test_ls_path() { .stdout_is(expected_stdout); let abs_path = format!("{}/{}", at.as_string(), path); - let expected_stdout = &format!("{}\n", abs_path); + let expected_stdout = if cfg!(windows) { + format!("\'{}\'\n", abs_path) + } else { + format!("{}\n", abs_path) + }; scene.ucmd().arg(&abs_path).run().stdout_is(expected_stdout); - let expected_stdout = &format!("{}\n{}\n", path, file1); + let expected_stdout = if cfg!(windows) { + format!("{} {}\n", path, file1) + } else { + format!("{}\n{}\n", path, file1) + }; scene .ucmd() .arg(file1)