From 6d0faac5e074a8a4e101da820e7e21a8a6c2ff2d Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Wed, 11 Mar 2026 19:18:53 +0000 Subject: internal: instantiate v1/package/{path} endpoint - Create handler for serving v1 package endpoint. - Create tests to verify endpoint behavior. Change-Id: I72701cb15d83baf4e31ed918c198adf347605a4a Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/754420 LUCI-TryBot-Result: Go LUCI kokoro-CI: kokoro Reviewed-by: Jonathan Amsterdam Auto-Submit: Ethan Lee --- internal/api/params_test.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'internal/api/params_test.go') diff --git a/internal/api/params_test.go b/internal/api/params_test.go index 6d325247..b630413b 100644 --- a/internal/api/params_test.go +++ b/internal/api/params_test.go @@ -45,21 +45,21 @@ func TestParseParams(t *testing.T) { }{ { name: "PackageParams", - values: url.Values{"module": {"m"}, "version": {"v1.0.0"}, "goos": {"linux"}, "examples": {"true"}}, + values: url.Values{"module": {"m"}, "version": {"v1.0.0"}, "goos": {"linux"}, "imports": {"true"}}, dst: &PackageParams{}, want: &PackageParams{ - Module: "m", - Version: "v1.0.0", - GOOS: "linux", - Examples: true, + Module: "m", + Version: "v1.0.0", + GOOS: "linux", + Imports: true, }, }, { name: "Boolean presence", - values: url.Values{"examples": {"true"}, "licenses": {"1"}}, + values: url.Values{"imports": {"true"}, "licenses": {"1"}}, dst: &PackageParams{}, want: &PackageParams{ - Examples: true, + Imports: true, Licenses: true, }, }, @@ -74,15 +74,15 @@ func TestParseParams(t *testing.T) { }, { name: "Empty bool", - values: url.Values{"examples": {""}}, + values: url.Values{"imports": {""}}, dst: &PackageParams{}, want: &PackageParams{ - Examples: false, + Imports: false, }, }, { name: "Invalid bool (on)", - values: url.Values{"examples": {"on"}}, + values: url.Values{"imports": {"on"}}, dst: &PackageParams{}, wantErr: true, }, @@ -124,7 +124,7 @@ func TestParseParams(t *testing.T) { }, { name: "Malformed bool", - values: url.Values{"examples": {"maybe"}}, + values: url.Values{"imports": {"maybe"}}, dst: &PackageParams{}, wantErr: true, }, -- cgit v1.3