From 5a2fc32f4475381b7c41823909c5ec098f07c040 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Fri, 25 Mar 2016 10:35:18 -0700 Subject: [PATCH] imports: adjust vendored packages test to keep working against 1.6 The prior commit fixed this test for tip (1.7) but broke it for 1.6. Change-Id: Ic39d215ac8bc60dba4b66201f1f16713b2e02d9c Reviewed-on: https://go-review.googlesource.com/21144 Reviewed-by: Alan Donovan --- imports/fix_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/imports/fix_test.go b/imports/fix_test.go index 49fc8ded..9e5ea8cb 100644 --- a/imports/fix_test.go +++ b/imports/fix_test.go @@ -909,6 +909,11 @@ func TestFindImportVendor(t *testing.T) { t.Fatal(err) } want := "golang.org/x/net/http2/hpack" + // Pre-1.7, we temporarily had this package under "internal" - adjust want accordingly. + _, err = os.Stat(filepath.Join(runtime.GOROOT(), "src/vendor", want)) + if err != nil { + want = filepath.Join("internal", want) + } if got != want || rename { t.Errorf(`findImportGoPath("hpack", HuffmanDecode ...)=%q, %t, want %q, false`, got, rename, want) }