1aa7d7321f
Add support for keeping parser diagnostic expectations in the source snippets they describe. Expectations are written as caret markers and diagnostic comments, and regenerated from the parser's actual diagnostics before comparison. This keeps parser recovery expectations close to the code under test and removes the need to maintain offset-based `assertErrors` lists by hand. The updater also removes existing expectation markers before writing the canonical form, so marked snippets can be refreshed in place. Migrate recovery parser and class parser tests to the new `assertExpectedDiagnostics` helper, including no-error cases where an unmarked snippet is the expected canonical form. Update `test_runner` to exclude `/pkg/analyzer/` from searching static error expectations. Bug: https://github.com/dart-lang/sdk/issues/63335 Change-Id: Ic9866da8cc601c6b360552ba576e8aa1646f89a5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501340 Commit-Queue: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Paul Berry <paulberry@google.com> Reviewed-by: Bob Nystrom <rnystrom@google.com>