Skip to content

Commit

Permalink
featu(packagesdriver): add _test suffix to pkgPath
Browse files Browse the repository at this point in the history
  • Loading branch information
JamyDev committed Dec 5, 2023
1 parent 499f609 commit 37ba8d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go/tools/gopackagesdriver/flatpackage.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (fp *FlatPackage) MoveTestFiles() *FlatPackage {
return &FlatPackage{
ID: fp.ID + "_xtest",
Name: fp.Name + "_test",
PkgPath: fp.PkgPath,
PkgPath: fp.PkgPath + "_test",
Imports: newImports,
Errors: fp.Errors,
GoFiles: append([]string{}, xtgf...),
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/gopackagesdriver/gopackagesdriver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ func TestExternalTests(t *testing.T) {

for _, p := range resp.Packages {
if p.ID == xTestId {
if !strings.HasSuffix(p.PkgPath, "_test") {
t.Errorf("PkgPath missing _test suffix")
}
assertSuffixesInList(t, p.GoFiles, "/hello_external_test.go")
} else if p.ID == testId {
assertSuffixesInList(t, p.GoFiles, "/hello.go", "/hello_test.go")
Expand Down

0 comments on commit 37ba8d5

Please sign in to comment.