// Copyright 2023 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn . package injectionutils_test import ( "github.com/TeaOSLab/EdgeNode/internal/waf/injectionutils" "github.com/TeaOSLab/EdgeNode/internal/waf/utils" "github.com/iwind/TeaGo/assert" "runtime" "testing" ) func TestDetectXSS(t *testing.T) { var a = assert.NewAssertion(t) a.IsFalse(injectionutils.DetectXSS("")) a.IsFalse(injectionutils.DetectXSS("abc")) a.IsTrue(injectionutils.DetectXSS("") 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") } }) }