From 18d9ce733e19c500ca04b4e744e6cdc5c6faf137 Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Sun, 6 Oct 2024 16:00:59 +0900 Subject: helper: test non-existent helpers Signed-off-by: Ophestra Umiker --- helper/stub.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'helper/stub.go') 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...)...) } } -- cgit v1.3.1