diff options
| author | Ophestra Umiker <cat@ophivana.moe> | 2024-09-29 15:22:35 +0900 |
|---|---|---|
| committer | Ophestra Umiker <cat@ophivana.moe> | 2024-09-29 15:22:35 +0900 |
| commit | 7e7327ebf8ba6323e9ba3ba38b27ed87fc578568 (patch) | |
| tree | 5ba1723800df6fedcde02d854ea96b4e0798dcca /helper/export_test.go | |
| parent | 3bf456da6593708823a967c4d88e4b0a816179dd (diff) | |
helper: export internal stub functions for cross-package testing
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'helper/export_test.go')
| -rw-r--r-- | helper/export_test.go | 18 |
1 files changed, 0 insertions, 18 deletions
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...)...) - } -} |
