From 4351af68eb053973f8782bf1514358e4a8d1ab00 Mon Sep 17 00:00:00 2001 From: Jes Cok Date: Thu, 25 Apr 2024 00:53:19 +0800 Subject: net/http: improve continue statements for tests Change-Id: I302368c17fbb6983bd14ab72784076e548ed8829 Reviewed-on: https://go-review.googlesource.com/c/go/+/581475 Auto-Submit: Ian Lance Taylor Commit-Queue: Ian Lance Taylor Reviewed-by: Damien Neil LUCI-TryBot-Result: Go LUCI Reviewed-by: Ian Lance Taylor --- src/net/http/cookie_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/net/http/cookie_test.go b/src/net/http/cookie_test.go index fdbe2723e3..1817fe1507 100644 --- a/src/net/http/cookie_test.go +++ b/src/net/http/cookie_test.go @@ -170,7 +170,6 @@ func TestWriteSetCookies(t *testing.T) { for i, tt := range writeSetCookiesTests { if g, e := tt.Cookie.String(), tt.Raw; g != e { t.Errorf("Test %d, expecting:\n%s\nGot:\n%s\n", i, e, g) - continue } } @@ -247,7 +246,6 @@ func TestAddCookie(t *testing.T) { } if g := req.Header.Get("Cookie"); g != tt.Raw { t.Errorf("Test %d:\nwant: %s\n got: %s\n", i, tt.Raw, g) - continue } } } @@ -407,7 +405,6 @@ func TestReadSetCookies(t *testing.T) { c := readSetCookies(tt.Header) if !reflect.DeepEqual(c, tt.Cookies) { t.Errorf("#%d readSetCookies: have\n%s\nwant\n%s\n", i, toJSON(c), toJSON(tt.Cookies)) - continue } } } @@ -477,7 +474,6 @@ func TestReadCookies(t *testing.T) { c := readCookies(tt.Header, tt.Filter) if !reflect.DeepEqual(c, tt.Cookies) { t.Errorf("#%d readCookies:\nhave: %s\nwant: %s\n", i, toJSON(c), toJSON(tt.Cookies)) - continue } } } @@ -883,6 +879,7 @@ func TestParseSetCookie(t *testing.T) { gotCookie, gotErr := ParseSetCookie(tt.line) if !errors.Is(gotErr, tt.err) { t.Errorf("#%d ParseSetCookie got error %v, want error %v", i, gotErr, tt.err) + continue } if !reflect.DeepEqual(gotCookie, tt.cookie) { t.Errorf("#%d ParseSetCookie:\ngot cookie: %s\nwant cookie: %s\n", i, toJSON(gotCookie), toJSON(tt.cookie)) -- cgit v1.2.3-54-g00ecf