Skip to content

Commit

Permalink
Fix tests in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
psibi committed Dec 1, 2024
1 parent 7c2e85a commit 9fe7237
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit 9fe7237

Please sign in to comment.