From 173b1bd4ba82b5ea85a0e763185dd2d42cc0e9a2 Mon Sep 17 00:00:00 2001 From: Sunny Date: Tue, 10 Oct 2017 18:57:20 +0530 Subject: [PATCH] Move bad go code under a vendor/ subdirectory. This fixes an issue where running `dep status` on dep itself resulted in error from ListPackages due to parsing the bad go code that exists in the testdata. --- internal/gps/_testdata/src/canon_confl/README.md | 3 +++ .../_testdata/src/canon_confl/{ => vendor/canon_confl}/a.go | 0 .../_testdata/src/canon_confl/{ => vendor/canon_confl}/b.go | 0 internal/gps/pkgtree/pkgtree_test.go | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 internal/gps/_testdata/src/canon_confl/README.md rename internal/gps/_testdata/src/canon_confl/{ => vendor/canon_confl}/a.go (100%) rename internal/gps/_testdata/src/canon_confl/{ => vendor/canon_confl}/b.go (100%) diff --git a/internal/gps/_testdata/src/canon_confl/README.md b/internal/gps/_testdata/src/canon_confl/README.md new file mode 100644 index 0000000000..0e22451fb4 --- /dev/null +++ b/internal/gps/_testdata/src/canon_confl/README.md @@ -0,0 +1,3 @@ +The packages inside `vendor/` directoy contain bad go code. This "vendor" +directory exists to avoid its content from being parsed by ListPackages when +running on the whole dep code base. diff --git a/internal/gps/_testdata/src/canon_confl/a.go b/internal/gps/_testdata/src/canon_confl/vendor/canon_confl/a.go similarity index 100% rename from internal/gps/_testdata/src/canon_confl/a.go rename to internal/gps/_testdata/src/canon_confl/vendor/canon_confl/a.go diff --git a/internal/gps/_testdata/src/canon_confl/b.go b/internal/gps/_testdata/src/canon_confl/vendor/canon_confl/b.go similarity index 100% rename from internal/gps/_testdata/src/canon_confl/b.go rename to internal/gps/_testdata/src/canon_confl/vendor/canon_confl/b.go diff --git a/internal/gps/pkgtree/pkgtree_test.go b/internal/gps/pkgtree/pkgtree_test.go index fb1c0e8814..aa634f590c 100644 --- a/internal/gps/pkgtree/pkgtree_test.go +++ b/internal/gps/pkgtree/pkgtree_test.go @@ -1315,7 +1315,7 @@ func TestListPackages(t *testing.T) { }, }, "conflicting canonical comments": { - fileRoot: j("canon_confl"), + fileRoot: j("canon_confl", "vendor", "canon_confl"), importRoot: "canon_confl", out: PackageTree{}, err: &ConflictingImportComments{