From 1fd9ceeb84524bf72c23266598324b66299ae5be Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Mon, 12 Feb 2024 21:35:55 +0100 Subject: [PATCH] test: don't fail on canonicalize --- crates/test-utils/src/util.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/test-utils/src/util.rs b/crates/test-utils/src/util.rs index ec54b1ef6c654..4555b7b44ecb6 100644 --- a/crates/test-utils/src/util.rs +++ b/crates/test-utils/src/util.rs @@ -614,7 +614,7 @@ 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 = forge.canonicalize().unwrap_or_else(|_| forge.clone()); let mut cmd = Command::new(forge); cmd.current_dir(self.inner.root()); // disable color output for comparisons @@ -625,7 +625,7 @@ 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 = cast.canonicalize().unwrap_or_else(|_| cast.clone()); let mut cmd = Command::new(cast); // disable color output for comparisons cmd.env("NO_COLOR", "1");