(b *testing.B)
| 3618 | } |
| 3619 | |
| 3620 | func BenchmarkParseParallel(b *testing.B) { |
| 3621 | p, err := NewParser( |
| 3622 | Macros(AllMacros...), |
| 3623 | MaxRecursionDepth(32), |
| 3624 | ErrorRecoveryLimit(4), |
| 3625 | ErrorRecoveryLookaheadTokenLimit(4), |
| 3626 | PopulateMacroCalls(true), |
| 3627 | ) |
| 3628 | if err != nil { |
| 3629 | b.Fatal(err) |
| 3630 | } |
| 3631 | b.ResetTimer() |
| 3632 | b.RunParallel(func(pb *testing.PB) { |
| 3633 | for pb.Next() { |
| 3634 | for _, testCase := range testCases { |
| 3635 | p.Parse(common.NewTextSource(testCase.I)) |
| 3636 | } |
| 3637 | } |
| 3638 | }) |
| 3639 | } |
| 3640 | |
| 3641 | type benchTestInfo struct { |
| 3642 | // I contains the input expression to be parsed. |
nothing calls this directly
no test coverage detected