改进变量分析测试用例

This commit is contained in:
刘祥超
2022-11-16 14:27:20 +08:00
parent 0f7482511e
commit e5ba474419

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) {
_ = ParseVariables("hello, ${name}, ${age}, ${gender}, ${home}, world", func(s string) string { for pb.Next() {
return "Lu" _ = ParseVariables("hello, ${name}, ${age}, ${gender}, ${home}, world", func(s string) string {
}) return "Lu"
} })
}
})
} }
func BenchmarkParseVariablesFromHolders(b *testing.B) { func BenchmarkParseVariablesFromHolders(b *testing.B) {