]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: convert TestIssue17119 to the script test framework
authorMichael Matloob <matloob@golang.org>
Mon, 30 Dec 2019 18:28:43 +0000 (13:28 -0500)
committerMichael Matloob <matloob@golang.org>
Mon, 6 Jan 2020 17:38:44 +0000 (17:38 +0000)
It's already parallel, but we might as well convert it and
get rid of the testdata/src dircetory completely.

Updates #36320

Change-Id: I75e335b32d64a8ddedd65e4337949b729c9e0fbe
Reviewed-on: https://go-review.googlesource.com/c/go/+/212877
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/go_test.go
src/cmd/go/testdata/script/gopath_vendor_dup_err.txt [new file with mode: 0644]
src/cmd/go/testdata/src/dupload/dupload.go [deleted file]
src/cmd/go/testdata/src/dupload/p/p.go [deleted file]
src/cmd/go/testdata/src/dupload/p2/p2.go [deleted file]
src/cmd/go/testdata/src/dupload/vendor/p/p.go [deleted file]

index 6a47c09bdeb08e367298c9bfd24007edcc82ec10..f8771ddff77e47a7842a6700cb1bc71bc58881d7 100644 (file)
@@ -3504,18 +3504,6 @@ func TestGoGetUpdateAllDoesNotTryToLoadDuplicates(t *testing.T) {
        tg.grepStderrNot("duplicate loads of", "did not remove old packages from cache")
 }
 
-// Issue 17119 more duplicate load errors
-func TestIssue17119(t *testing.T) {
-       testenv.MustHaveExternalNetwork(t)
-
-       tg := testgo(t)
-       defer tg.cleanup()
-       tg.parallel()
-       tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
-       tg.runFail("build", "dupload")
-       tg.grepBothNot("duplicate load|internal error", "internal error")
-}
-
 func TestBinaryOnlyPackages(t *testing.T) {
        tooSlow(t)
 
diff --git a/src/cmd/go/testdata/script/gopath_vendor_dup_err.txt b/src/cmd/go/testdata/script/gopath_vendor_dup_err.txt
new file mode 100644 (file)
index 0000000..5096195
--- /dev/null
@@ -0,0 +1,24 @@
+[!net] skip
+
+# Issue 17119: Test more duplicate load errors.
+! go build dupload
+! stderr 'duplicate load|internal error'
+stderr 'dupload/vendor/p must be imported as p'
+
+-- dupload/dupload.go --
+package main
+
+import (
+       _ "dupload/p2"
+       _ "p"
+)
+
+func main() {}
+-- dupload/p/p.go --
+package p
+-- dupload/p2/p2.go --
+package p2
+
+import _ "dupload/vendor/p"
+-- dupload/vendor/p/p.go --
+package p
diff --git a/src/cmd/go/testdata/src/dupload/dupload.go b/src/cmd/go/testdata/src/dupload/dupload.go
deleted file mode 100644 (file)
index 2f07852..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-package main
-
-import (
-       _ "dupload/p2"
-       _ "p"
-)
-
-func main() {}
diff --git a/src/cmd/go/testdata/src/dupload/p/p.go b/src/cmd/go/testdata/src/dupload/p/p.go
deleted file mode 100644 (file)
index c89cd18..0000000
+++ /dev/null
@@ -1 +0,0 @@
-package p
diff --git a/src/cmd/go/testdata/src/dupload/p2/p2.go b/src/cmd/go/testdata/src/dupload/p2/p2.go
deleted file mode 100644 (file)
index 8a80979..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-package p2
-
-import _ "dupload/vendor/p"
diff --git a/src/cmd/go/testdata/src/dupload/vendor/p/p.go b/src/cmd/go/testdata/src/dupload/vendor/p/p.go
deleted file mode 100644 (file)
index c89cd18..0000000
+++ /dev/null
@@ -1 +0,0 @@
-package p