From 0116156a53ec2184636eb7a97507e61c773f4979 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Sun, 24 May 2026 12:18:59 -0400 Subject: [PATCH] tests: fix "gpatch --version" error message on mac When we fail to find `gpatch`, don't say that we failed to find `patch`. Cosmetic fix to commit 1254f146f8f1 ("tests: validate "patch" and "ed" commands once, print meaningful messages (#226)") This is an extremely minor fix because the error message already printed "gpatch validation failed, no such file or directory" even before this commit. Signed-off-by: Marc Herbert --- src/utils.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils.rs b/src/utils.rs index 5e09bde..d9415af 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -150,7 +150,7 @@ pub mod testcmds { pub static PATCH_CMD: CmdFactory = CmdFactory { cmd: if cfg!(target_os = "macos") { - "gpatch" // brew install patch + "gpatch" // brew install gpatch } else { "patch" }, @@ -160,7 +160,7 @@ pub mod testcmds { let output = Command::new(myself.cmd) .arg("--version") .output() - .expect("`patch --version` failed"); + .expect(format!("`{} --version` failed", myself.cmd).as_str()); // Non-GNU versions have subtle differences. When some newlines are missing in some test // patches, the macOS version can even stall the whole test run. assert!(output.stdout.starts_with(b"GNU patch"));