diff --git a/ctx_test.go b/ctx_test.go index 0c76c4bd58..8ac59e553d 100644 --- a/ctx_test.go +++ b/ctx_test.go @@ -1005,7 +1005,6 @@ func Test_Ctx_CookieParserUsingTag(t *testing.T) { c.Request().Header.Set("Cookie", "dates[]=7,6,10") utils.AssertEqual(t, nil, c.CookieParser(ac)) utils.AssertEqual(t, 3, len(ac.Dates)) - } // go test -run Test_Ctx_CookieParserSchema -v @@ -1038,8 +1037,8 @@ func Test_Ctx_CookieParser_Schema(t *testing.T) { c.Request().Header.Set("Cookie", "result.maths=10") c.Request().Header.Set("Cookie", "result.english=10") hR := new(resStruct) - c.CookieParser(hR) + utils.AssertEqual(t, nil, c.CookieParser(hR)) utils.AssertEqual(t, *res, *hR) t.Log(*hR) } @@ -1067,10 +1066,13 @@ func Benchmark_Ctx_CookieParser(b *testing.B) { c.Request().Header.Set("Cookie", "fee=45.78") c.Request().Header.Set("Cookie", "score=7,6,10") + var err error // Run the function b.N times for i := 0; i < b.N; i++ { - _ = c.CookieParser(cookie1) + err = c.CookieParser(cookie1) } + + utils.AssertEqual(b, nil, err) } // go test -run Test_Ctx_Cookies