internal/fetch: update _ directory test for extractReadme
Update the unit test to have an explicit _ test case that is
distinct from the stdlib case and rename the stdlib case.
Change-Id: If0d2f35c66ae42666fb773d50cc58bcae8b0a5ac
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/529376
kokoro-CI: kokoro <noreply+kokoro@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
diff --git a/internal/fetch/readme_test.go b/internal/fetch/readme_test.go
index ba697a3..affcead 100644
--- a/internal/fetch/readme_test.go
+++ b/internal/fetch/readme_test.go
@@ -35,7 +35,7 @@
want []*internal.Readme
}{
{
- name: "README at root and README in unit",
+ name: "README at root and README in unit and README in _",
modulePath: stdlib.ModulePath,
version: "v1.12.5",
want: []*internal.Readme{
@@ -47,13 +47,10 @@
},
{
name: "directory start with _",
- modulePath: stdlib.ModulePath,
- version: "v1.12.5",
- want: []*internal.Readme{
- {
- Filepath: "cmd/pprof/README",
- Contents: "This directory is the copy of Google's pprof shipped as part of the Go distribution.\n",
- },
+ modulePath: "github.com/my/module",
+ version: "v1.0.0",
+ files: map[string]string{
+ "_foo/README.md": "README",
},
},
{