aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/vendor_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/go/vendor_test.go')
-rw-r--r--src/cmd/go/vendor_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/cmd/go/vendor_test.go b/src/cmd/go/vendor_test.go
index 006a8c9d3f..4cf2b0c3e7 100644
--- a/src/cmd/go/vendor_test.go
+++ b/src/cmd/go/vendor_test.go
@@ -244,6 +244,32 @@ func TestVendorTest2(t *testing.T) {
tg.run("test", "github.com/rsc/go-get-issue-11864/vendor/vendor.org/tx2")
}
+func TestVendorTest3(t *testing.T) {
+ testenv.MustHaveExternalNetwork(t)
+
+ tg := testgo(t)
+ defer tg.cleanup()
+ tg.makeTempdir()
+ tg.setenv("GOPATH", tg.path("."))
+ tg.run("get", "github.com/clsung/go-vendor-issue-14613")
+
+ tg.run("build", "-i", "github.com/clsung/go-vendor-issue-14613")
+
+ // test folder should work
+ tg.run("test", "-i", "github.com/clsung/go-vendor-issue-14613")
+ tg.run("test", "github.com/clsung/go-vendor-issue-14613")
+
+ // test with specified _test.go should work too
+ tg.cd(filepath.Join(tg.path("."), "src"))
+ tg.run("test", "-i", "github.com/clsung/go-vendor-issue-14613/vendor_test.go")
+ tg.run("test", "github.com/clsung/go-vendor-issue-14613/vendor_test.go")
+
+ // test with imported and not used
+ tg.run("test", "-i", "github.com/clsung/go-vendor-issue-14613/vendor/mylibtesttest/myapp/myapp_test.go")
+ tg.runFail("test", "github.com/clsung/go-vendor-issue-14613/vendor/mylibtesttest/myapp/myapp_test.go")
+ tg.grepStderr("imported and not used:", `should say "imported and not used"`)
+}
+
func TestVendorList(t *testing.T) {
testenv.MustHaveExternalNetwork(t)