Skip to content

Commit

Permalink
go/expect: remove testdata go.mod to go.fake.mod
Browse files Browse the repository at this point in the history
go.mod defines a module boundary, making the go/expect test fail when
run as a dependency of another module because the testdata is missing.

Rename go.mod to go.fake.mod to keep it in the parent module. go/expect
will still parse it as a mod file.

Fixes #57783.

Change-Id: Ib17af058e26042bf5148e9aa11fc3d7f9b9c6e7f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/461942
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
  • Loading branch information
prattmic authored and gopherbot committed Jan 13, 2023
1 parent 1e819a3 commit 03eac81
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go/expect/expect_test.go
Expand Up @@ -43,7 +43,7 @@ func TestMarker(t *testing.T) {
},
},
{
filename: "testdata/go.mod",
filename: "testdata/go.fake.mod",
expectNotes: 2,
expectMarkers: map[string]string{
"αMarker": "αfake1α",
Expand Down
9 changes: 9 additions & 0 deletions go/expect/testdata/go.fake.mod
@@ -0,0 +1,9 @@
// This file is named go.fake.mod so it does not define a real module, which
// would make the contents of this directory unavailable to the test when run
// from outside the repository.

module αfake1α //@mark(αMarker, "αfake1α")

go 1.14

require golang.org/modfile v0.0.0 //@mark(βMarker, "require golang.org/modfile v0.0.0")
5 changes: 0 additions & 5 deletions go/expect/testdata/go.mod

This file was deleted.

0 comments on commit 03eac81

Please sign in to comment.