Helper method for benchmarking various parsing methods
(b *testing.B, parser *jwt.Parser, tokenString string, claims jwt.Claims)
| 862 | |
| 863 | // Helper method for benchmarking various parsing methods |
| 864 | func benchmarkParsing(b *testing.B, parser *jwt.Parser, tokenString string, claims jwt.Claims) { |
| 865 | b.Helper() |
| 866 | b.ReportAllocs() |
| 867 | b.ResetTimer() |
| 868 | b.RunParallel(func(pb *testing.PB) { |
| 869 | for pb.Next() { |
| 870 | _, _, err := parser.ParseUnverified(tokenString, jwt.MapClaims{}) |
| 871 | if err != nil { |
| 872 | b.Fatal(err) |
| 873 | } |
| 874 | } |
| 875 | }) |
| 876 | } |
| 877 | |
| 878 | // Helper method for benchmarking various signing methods |
| 879 | func benchmarkSigning(b *testing.B, method jwt.SigningMethod, key any) { |
no test coverage detected