(b *testing.B)
| 2354 | } |
| 2355 | |
| 2356 | func BenchmarkParse(b *testing.B) { |
| 2357 | p, err := NewParser( |
| 2358 | Macros(AllMacros...), |
| 2359 | MaxRecursionDepth(32), |
| 2360 | ErrorRecoveryLimit(4), |
| 2361 | ErrorRecoveryLookaheadTokenLimit(4), |
| 2362 | PopulateMacroCalls(true), |
| 2363 | ) |
| 2364 | if err != nil { |
| 2365 | b.Fatal(err) |
| 2366 | } |
| 2367 | b.ResetTimer() |
| 2368 | for n := 0; n < b.N; n++ { |
| 2369 | for _, testCase := range testCases { |
| 2370 | p.Parse(common.NewTextSource(testCase.I)) |
| 2371 | } |
| 2372 | } |
| 2373 | } |
| 2374 | |
| 2375 | func BenchmarkParseParallel(b *testing.B) { |
| 2376 | p, err := NewParser( |
nothing calls this directly
no test coverage detected