aboutsummaryrefslogtreecommitdiffhomepage
path: root/helper/stub.go
diff options
context:
space:
mode:
authorOphestra Umiker <cat@ophivana.moe>2024-10-06 16:00:59 +0900
committerOphestra Umiker <cat@ophivana.moe>2024-10-06 16:00:59 +0900
commit18d9ce733e19c500ca04b4e744e6cdc5c6faf137 (patch)
tree93b8232b6acc58470de1ef217d2dd656817424d2 /helper/stub.go
parentba76e2919b6791c78d2c1e79cb50dbc4731a5b00 (diff)
helper: test non-existent helpers
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'helper/stub.go')
-rw-r--r--helper/stub.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/helper/stub.go b/helper/stub.go
index 32dc11e9..6a591733 100644
--- a/helper/stub.go
+++ b/helper/stub.go
@@ -85,6 +85,11 @@ func InternalReplaceExecCommand(t *testing.T) {
// replace execCommand to have the resulting *exec.Cmd launch TestHelperChildStub
execCommand = func(name string, arg ...string) *exec.Cmd {
+ // pass through nonexistent path
+ if name == "/nonexistent" && len(arg) == 0 {
+ return exec.Command(name)
+ }
+
return exec.Command(os.Args[0], append([]string{"-test.run=TestHelperChildStub", "--", name}, arg...)...)
}
}