MCPcopy
hub / github.com/gofiber/fiber / Benchmark_CSRF_SubdomainMatch

Function Benchmark_CSRF_SubdomainMatch

middleware/csrf/helpers_test.go:173–186  ·  view source on GitHub ↗

go test -v -run=^$ -bench=Benchmark_CSRF_SubdomainMatch -benchmem -count=4

(b *testing.B)

Source from the content-addressed store, hash-verified

171
172// go test -v -run=^$ -bench=Benchmark_CSRF_SubdomainMatch -benchmem -count=4
173func Benchmark_CSRF_SubdomainMatch(b *testing.B) {
174 s := subdomain{
175 prefix: "www",
176 suffix: "example.com",
177 }
178
179 o := "www.example.com"
180
181 b.ReportAllocs()
182
183 for b.Loop() {
184 s.match(o)
185 }
186}
187
188func Test_CSRF_Security_CompareConstantTime(t *testing.T) {
189 t.Parallel()

Callers

nothing calls this directly

Calls 1

matchMethod · 0.95

Tested by

no test coverage detected