From 74b12eef5ee2e500521f3017171c9cc2c306879d Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Mon, 12 Feb 2024 23:16:03 +0200 Subject: [PATCH] test: don't fail on canonicalize (#7094) --- crates/test-utils/src/util.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/test-utils/src/util.rs b/crates/test-utils/src/util.rs index ec54b1ef6c65..ca081bf63edc 100644 --- a/crates/test-utils/src/util.rs +++ b/crates/test-utils/src/util.rs @@ -613,8 +613,8 @@ impl TestProject { /// Returns the path to the forge executable. pub fn forge_bin(&self) -> Command { - let forge = self.exe_root.join("../forge").with_extension(env::consts::EXE_SUFFIX); - let forge = forge.canonicalize().unwrap(); + let forge = self.exe_root.join(format!("../forge{}", env::consts::EXE_SUFFIX)); + let forge = forge.canonicalize().unwrap_or_else(|_| forge.clone()); let mut cmd = Command::new(forge); cmd.current_dir(self.inner.root()); // disable color output for comparisons @@ -624,8 +624,8 @@ impl TestProject { /// Returns the path to the cast executable. pub fn cast_bin(&self) -> Command { - let cast = self.exe_root.join("../cast").with_extension(env::consts::EXE_SUFFIX); - let cast = cast.canonicalize().unwrap(); + let cast = self.exe_root.join(format!("../cast{}", env::consts::EXE_SUFFIX)); + let cast = cast.canonicalize().unwrap_or_else(|_| cast.clone()); let mut cmd = Command::new(cast); // disable color output for comparisons cmd.env("NO_COLOR", "1");