(b *testing.B)
| 2374 | } |
| 2375 | |
| 2376 | func BenchmarkParseParallel(b *testing.B) { |
| 2377 | p, err := NewParser( |
| 2378 | Macros(AllMacros...), |
| 2379 | MaxRecursionDepth(32), |
| 2380 | ErrorRecoveryLimit(4), |
| 2381 | ErrorRecoveryLookaheadTokenLimit(4), |
| 2382 | PopulateMacroCalls(true), |
| 2383 | ) |
| 2384 | if err != nil { |
| 2385 | b.Fatal(err) |
| 2386 | } |
| 2387 | b.ResetTimer() |
| 2388 | b.RunParallel(func(pb *testing.PB) { |
| 2389 | for pb.Next() { |
| 2390 | for _, testCase := range testCases { |
| 2391 | p.Parse(common.NewTextSource(testCase.I)) |
| 2392 | } |
| 2393 | } |
| 2394 | }) |
| 2395 | } |
| 2396 | |
| 2397 | type benchTestInfo struct { |
| 2398 | // I contains the input expression to be parsed. |
nothing calls this directly
no test coverage detected