Skip to content

Commit b4b04b8

Browse files
authored
featu(packagesdriver): add _test suffix to pkgPath (#3777)
1 parent 499f609 commit b4b04b8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

go/tools/gopackagesdriver/flatpackage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func (fp *FlatPackage) MoveTestFiles() *FlatPackage {
154154
return &FlatPackage{
155155
ID: fp.ID + "_xtest",
156156
Name: fp.Name + "_test",
157-
PkgPath: fp.PkgPath,
157+
PkgPath: fp.PkgPath + "_test",
158158
Imports: newImports,
159159
Errors: fp.Errors,
160160
GoFiles: append([]string{}, xtgf...),

tests/integration/gopackagesdriver/gopackagesdriver_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ func TestExternalTests(t *testing.T) {
175175

176176
for _, p := range resp.Packages {
177177
if p.ID == xTestId {
178+
if !strings.HasSuffix(p.PkgPath, "_test") {
179+
t.Errorf("PkgPath missing _test suffix")
180+
}
178181
assertSuffixesInList(t, p.GoFiles, "/hello_external_test.go")
179182
} else if p.ID == testId {
180183
assertSuffixesInList(t, p.GoFiles, "/hello.go", "/hello_test.go")

0 commit comments

Comments
 (0)