改进变量分析测试用例

This commit is contained in:
GoEdgeLab
2022-11-16 14:27:20 +08:00
parent c4611e2986
commit 17c53d8b38

View File

@@ -55,11 +55,13 @@ func BenchmarkParseVariables(b *testing.B) {
b.ResetTimer() b.ResetTimer()
for i := 0; i < b.N; i++ { b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
_ = ParseVariables("hello, ${name}, ${age}, ${gender}, ${home}, world", func(s string) string { _ = ParseVariables("hello, ${name}, ${age}, ${gender}, ${home}, world", func(s string) string {
return "Lu" return "Lu"
}) })
} }
})
} }
func BenchmarkParseVariablesFromHolders(b *testing.B) { func BenchmarkParseVariablesFromHolders(b *testing.B) {