(b *testing.B)
| 2355 | } |
| 2356 | |
| 2357 | func BenchmarkParseParallel(b *testing.B) { |
| 2358 | p, err := NewParser( |
| 2359 | Macros(AllMacros...), |
| 2360 | MaxRecursionDepth(32), |
| 2361 | ErrorRecoveryLimit(4), |
| 2362 | ErrorRecoveryLookaheadTokenLimit(4), |
| 2363 | PopulateMacroCalls(true), |
| 2364 | ) |
| 2365 | if err != nil { |
| 2366 | b.Fatal(err) |
| 2367 | } |
| 2368 | b.ResetTimer() |
| 2369 | b.RunParallel(func(pb *testing.PB) { |
| 2370 | for pb.Next() { |
| 2371 | for _, testCase := range testCases { |
| 2372 | p.Parse(common.NewTextSource(testCase.I)) |
| 2373 | } |
| 2374 | } |
| 2375 | }) |
| 2376 | } |
| 2377 | |
| 2378 | func TestParseErrorData(t *testing.T) { |
| 2379 | p := newTestParser(t) |
nothing calls this directly
no test coverage detected