diff --git a/src/cmd/go/internal/clean/clean_test.go b/src/cmd/go/internal/clean/clean_test.go deleted file mode 100644 index dc0af06b706..00000000000 --- a/src/cmd/go/internal/clean/clean_test.go +++ /dev/null @@ -1,24 +0,0 @@ -package clean - -import ( - "os/exec" - "strings" - "testing" -) - -func TestCleanCache(t *testing.T) { - cmd := exec.Command("go", "clean", "-cache") - // See issue 69997. GOCACHE must be an absolute path. - cmd.Env = append(cmd.Environ(), "GOCACHE='.cache'") - _, err := cmd.Output() - - if err != nil { - ee, ok := err.(*exec.ExitError) - if !ok || ee.ExitCode() != 1 || !strings.Contains(string(ee.Stderr), "GOCACHE is not an absolute path") { - t.Errorf("\"go clean -cache\" failed. expected status 1 != %d; error: %s", ee.ExitCode(), ee.Stderr) - } - } else { - t.Errorf("expected go clean -cache to fail") - } - -} diff --git a/src/cmd/go/testdata/script/clean_cache_n.txt b/src/cmd/go/testdata/script/clean_cache_n.txt index 72f9abf9ae1..52e9029847e 100644 --- a/src/cmd/go/testdata/script/clean_cache_n.txt +++ b/src/cmd/go/testdata/script/clean_cache_n.txt @@ -18,6 +18,11 @@ go clean -cache ! go clean -cache . stderr 'go: clean -cache cannot be used with package arguments' +# GOCACHE must be an absolute path. +env GOCACHE=. +! go clean -cache +stderr 'go: GOCACHE is not an absolute path' + -- main.go -- package main