]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: convert TestIssue11709 to the script framework
authorMichael Matloob <matloob@golang.org>
Mon, 13 Jan 2020 15:51:28 +0000 (10:51 -0500)
committerMichael Matloob <matloob@golang.org>
Wed, 19 Feb 2020 21:59:50 +0000 (21:59 +0000)
Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I16fb0910196c96caef6ed380f96010a548407f9e
Reviewed-on: https://go-review.googlesource.com/c/go/+/214424
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/go_test.go
src/cmd/go/testdata/script/run_issue11709.txt [new file with mode: 0644]

index f67cf2583a9c18c4eb69869636b74e4ba389c47c..198eafccb14ff3036cc0ca4218cfb465484098fa 100644 (file)
@@ -2174,21 +2174,6 @@ func TestGoBuildGOPATHOrderBroken(t *testing.T) {
        tg.run("install", "-x", "bar")
 }
 
-func TestIssue11709(t *testing.T) {
-       tg := testgo(t)
-       defer tg.cleanup()
-       tg.tempFile("run.go", `
-               package main
-               import "os"
-               func main() {
-                       if os.Getenv("TERM") != "" {
-                               os.Exit(1)
-                       }
-               }`)
-       tg.unsetenv("TERM")
-       tg.run("run", tg.path("run.go"))
-}
-
 func TestGoBuildARM(t *testing.T) {
        if testing.Short() {
                t.Skip("skipping cross-compile in short mode")
diff --git a/src/cmd/go/testdata/script/run_issue11709.txt b/src/cmd/go/testdata/script/run_issue11709.txt
new file mode 100644 (file)
index 0000000..c8ba998
--- /dev/null
@@ -0,0 +1,15 @@
+# 'go run' should not pass extraneous environment variables to the subprocess.
+go run run.go
+! stdout .
+! stderr .
+
+-- run.go --
+package main
+
+import "os"
+
+func main() {
+       if os.Getenv("TERM") != "" {
+               os.Exit(1)
+       }
+}
\ No newline at end of file