MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / BenchmarkDetectXSS_MISS

Function BenchmarkDetectXSS_MISS

internal/waf/injectionutils/utils_xss_test.go:51–64  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

49}
50
51func BenchmarkDetectXSS_MISS(b *testing.B) {
52 var result = injectionutils.DetectXSS("<html><body><span>RequestId: 1234567890</span></body></html>", false)
53 if result {
54 b.Fatal("'result' should not be 'true'")
55 }
56
57 runtime.GOMAXPROCS(4)
58
59 b.RunParallel(func(pb *testing.PB) {
60 for pb.Next() {
61 _ = injectionutils.DetectXSS("<html><body><span>RequestId: 1234567890</span></body></html>", false)
62 }
63 })
64}
65
66func BenchmarkDetectXSS_MISS_Cache(b *testing.B) {
67 var result = injectionutils.DetectXSS("<html><body><span>RequestId: 1234567890</span></body></html>", false)

Callers

nothing calls this directly

Calls 2

DetectXSSFunction · 0.92
NextMethod · 0.80

Tested by

no test coverage detected