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