Skip to content

Commit 0116156

Browse files
committed
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 1254f14 ("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 <Marc.Herbert@gmail.com>
1 parent 1254f14 commit 0116156

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ pub mod testcmds {
150150

151151
pub static PATCH_CMD: CmdFactory = CmdFactory {
152152
cmd: if cfg!(target_os = "macos") {
153-
"gpatch" // brew install patch
153+
"gpatch" // brew install gpatch
154154
} else {
155155
"patch"
156156
},
@@ -160,7 +160,7 @@ pub mod testcmds {
160160
let output = Command::new(myself.cmd)
161161
.arg("--version")
162162
.output()
163-
.expect("`patch --version` failed");
163+
.expect(format!("`{} --version` failed", myself.cmd).as_str());
164164
// Non-GNU versions have subtle differences. When some newlines are missing in some test
165165
// patches, the macOS version can even stall the whole test run.
166166
assert!(output.stdout.starts_with(b"GNU patch"));

0 commit comments

Comments
 (0)