// Copyright 2023 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cloud . package injectionutils_test import ( "runtime" "testing" "github.com/TeaOSLab/EdgeNode/internal/waf/injectionutils" "github.com/TeaOSLab/EdgeNode/internal/waf/utils" "github.com/iwind/TeaGo/assert" ) func TestDetectXSS(t *testing.T) { var a = assert.NewAssertion(t) a.IsFalse(injectionutils.DetectXSS("", true)) a.IsFalse(injectionutils.DetectXSS("abc", true)) a.IsTrue(injectionutils.DetectXSS("", false) if !result { b.Fatal("'result' should not be 'false'") } runtime.GOMAXPROCS(4) b.RunParallel(func(pb *testing.PB) { for pb.Next() { _ = injectionutils.DetectXSS("RequestId: 1234567890", false) } }) }