(b *testing.B)
| 79 | } |
| 80 | |
| 81 | func BenchmarkDetectXSS_HIT(b *testing.B) { |
| 82 | var result = injectionutils.DetectXSS("<html><body><span>RequestId: 1234567890</span><script src=\"\"></script></body></html>", false) |
| 83 | if !result { |
| 84 | b.Fatal("'result' should not be 'false'") |
| 85 | } |
| 86 | |
| 87 | runtime.GOMAXPROCS(4) |
| 88 | |
| 89 | b.RunParallel(func(pb *testing.PB) { |
| 90 | for pb.Next() { |
| 91 | _ = injectionutils.DetectXSS("<html><body><span>RequestId: 1234567890</span><script src=\"\"></script></body></html>", false) |
| 92 | } |
| 93 | }) |
| 94 | } |