net/http: correct error messages for TestParseSetCookie

This change fixes typos in error messages, while here, also improves
'line' strings to indicate the errEqualNotFoundInCookie error.

Change-Id: I0ce6115c605844d2d86f337f208fd3b2d3774674
Reviewed-on: https://go-review.googlesource.com/c/go/+/579799
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Joedian Reid <joedian@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
This commit is contained in:
Jes Cok 2024-04-20 16:27:17 +08:00 committed by Gopher Robot
parent 5a3b6400ef
commit 674657e130
1 changed files with 4 additions and 4 deletions

View File

@ -709,7 +709,7 @@ func TestParseCookie(t *testing.T) {
err: errBlankCookie,
},
{
line: "whatever",
line: "equal-not-found",
err: errEqualNotFoundInCookie,
},
{
@ -867,7 +867,7 @@ func TestParseSetCookie(t *testing.T) {
err: errBlankCookie,
},
{
line: "whatever",
line: "equal-not-found",
err: errEqualNotFoundInCookie,
},
{
@ -882,10 +882,10 @@ func TestParseSetCookie(t *testing.T) {
for i, tt := range tests {
gotCookie, gotErr := ParseSetCookie(tt.line)
if !errors.Is(gotErr, tt.err) {
t.Errorf("#%d ParseCookie got error %v, want error %v", i, gotErr, tt.err)
t.Errorf("#%d ParseSetCookie got error %v, want error %v", i, gotErr, tt.err)
}
if !reflect.DeepEqual(gotCookie, tt.cookie) {
t.Errorf("#%d ParseCookie:\ngot cookie: %s\nwant cookie: %s\n", i, toJSON(gotCookie), toJSON(tt.cookie))
t.Errorf("#%d ParseSetCookie:\ngot cookie: %s\nwant cookie: %s\n", i, toJSON(gotCookie), toJSON(tt.cookie))
}
}
}