Skip to content

Commit 0d7e290

Browse files
bystonesnicholashusin
authored andcommitted
internal/frontend/fetchserver: add test for "synctest" shortcut
The previous commit 5cd4436 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 <[email protected]> Reviewed-by: Nicholas Husin <[email protected]> Reviewed-by: Junyang Shao <[email protected]> Reviewed-by: Nicholas Husin <[email protected]> Auto-Submit: Nicholas Husin <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 94b2daf commit 0d7e290

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

internal/frontend/fetchserver/server_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,14 @@ var testModules = []testModule{
169169
name: "asan",
170170
suffix: "internal/asan",
171171
},
172+
{
173+
name: "synctest",
174+
suffix: "internal/synctest",
175+
},
176+
{
177+
name: "synctest",
178+
suffix: "testing/synctest",
179+
},
172180
},
173181
},
174182
{
@@ -704,6 +712,12 @@ func serverTestCases() []serverTestCase {
704712
urlPath: "/boring",
705713
wantStatusCode: http.StatusNotFound,
706714
},
715+
{
716+
name: "stdlib shortcut (testing/synctest) with internal package (internal/synctest)",
717+
urlPath: "/synctest",
718+
wantStatusCode: http.StatusFound,
719+
wantLocation: "/testing/synctest",
720+
},
707721
{
708722
name: "package page with trailiing slash",
709723
urlPath: "/github.com/my/module/",

0 commit comments

Comments
 (0)