From 7e7327ebf8ba6323e9ba3ba38b27ed87fc578568 Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Sun, 29 Sep 2024 15:22:35 +0900 Subject: helper: export internal stub functions for cross-package testing Signed-off-by: Ophestra Umiker --- helper/export_test.go | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 helper/export_test.go (limited to 'helper/export_test.go') diff --git a/helper/export_test.go b/helper/export_test.go deleted file mode 100644 index 6bf18ce3..00000000 --- a/helper/export_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package helper - -import ( - "os" - "os/exec" - "testing" -) - -// replace execCommand to have the resulting *exec.Cmd launch TestHelperChildStub -func ReplaceExecCommand(t *testing.T) { - t.Cleanup(func() { - execCommand = exec.Command - }) - - execCommand = func(name string, arg ...string) *exec.Cmd { - return exec.Command(os.Args[0], append([]string{"-test.run=TestHelperChildStub", "--", name}, arg...)...) - } -} -- cgit v1.3.1