diff options
| author | Felix Stein <bystones92@gmail.com> | 2025-11-05 22:27:46 +0100 |
|---|---|---|
| committer | Nicholas Husin <nsh@golang.org> | 2025-11-05 18:26:50 -0800 |
| commit | 0d7e29046a911358f7f5a5c4028a9db875187281 (patch) | |
| tree | 599908f8f3e93817df44353e88b793ac0d7202e8 | |
| parent | 94b2daf9e053e5e1effa3ae6a610d99d3e43d8b1 (diff) | |
| download | go-x-pkgsite-0d7e29046a911358f7f5a5c4028a9db875187281.tar.xz | |
internal/frontend/fetchserver: add test for "synctest" shortcut
The previous commit 5cd44362491235c04771c4d8dfcacdd265ada373 added tests
that internal packages are not found by a shortcut. This change adds a
test that a package (like synctest) which has an internal and public
package is found.
Updates golang/go#76136
Change-Id: I80297ee6fff7fbb1c2d5bd2188a387a39f24ac35
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/718280
TryBot-Bypass: Nicholas Husin <nsh@golang.org>
Reviewed-by: Nicholas Husin <nsh@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Auto-Submit: Nicholas Husin <nsh@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
| -rw-r--r-- | internal/frontend/fetchserver/server_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/frontend/fetchserver/server_test.go b/internal/frontend/fetchserver/server_test.go index 23d31bc0..0ef26648 100644 --- a/internal/frontend/fetchserver/server_test.go +++ b/internal/frontend/fetchserver/server_test.go @@ -169,6 +169,14 @@ var testModules = []testModule{ name: "asan", suffix: "internal/asan", }, + { + name: "synctest", + suffix: "internal/synctest", + }, + { + name: "synctest", + suffix: "testing/synctest", + }, }, }, { @@ -705,6 +713,12 @@ func serverTestCases() []serverTestCase { wantStatusCode: http.StatusNotFound, }, { + name: "stdlib shortcut (testing/synctest) with internal package (internal/synctest)", + urlPath: "/synctest", + wantStatusCode: http.StatusFound, + wantLocation: "/testing/synctest", + }, + { name: "package page with trailiing slash", urlPath: "/github.com/my/module/", wantStatusCode: http.StatusMovedPermanently, |
