From 9fe723724a9697ec71bcb357cd29df2123ebc9b4 Mon Sep 17 00:00:00 2001 From: Sibi Prabakaran Date: Sun, 1 Dec 2024 15:58:54 +0530 Subject: [PATCH] Fix tests in Windows --- tests/test.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/test.rs b/tests/test.rs index e65762ec37..5edf008c0c 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -121,12 +121,20 @@ impl Test { pub(crate) fn justfile_path(&self) -> PathBuf { // Doing canonicalize for tests in MacOS (Github actions) - self.tempdir.path().canonicalize().unwrap().join("justfile") + if cfg!(target_os = "macos") { + self.tempdir.path().canonicalize().unwrap().join("justfile") + } else { + self.tempdir.path().join("justfile") + } } pub(crate) fn new_justfile_path(&self, justfile: PathBuf) -> PathBuf { // Doing canonicalize for tests in MacOS (Github actions) - self.tempdir.path().canonicalize().unwrap().join(justfile) + if cfg!(target_os = "macos") { + self.tempdir.path().canonicalize().unwrap().join(justfile) + } else { + self.tempdir.path().join(justfile) + } } #[cfg(unix)]