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

Function TestMatchBytesCache_WithoutCache

internal/waf/utils/utils_test.go:51–57  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

49}
50
51func TestMatchBytesCache_WithoutCache(t *testing.T) {
52 data := []byte(strings.Repeat("HELLO", 512))
53 regex := regexp.MustCompile(`(?iU)\b(eval|system|exec|execute|passthru|shell_exec|phpinfo)\b`)
54 before := time.Now()
55 t.Log(regex.Match(data))
56 t.Log(time.Since(before).Seconds()*1000, "ms")
57}
58
59func BenchmarkMatchStringCache(b *testing.B) {
60 runtime.GOMAXPROCS(1)

Callers

nothing calls this directly

Calls 2

LogMethod · 0.80
MatchMethod · 0.45

Tested by

no test coverage detected