dart-lang / sdk

The Dart SDK, including the VM, dart2js, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
9.96k stars 1.53k forks source link

Codegen of syntactic_errors.g.dart doesn't appear to be unit tested #44888

Open stereotype441 opened 3 years ago

stereotype441 commented 3 years ago

In https://dart-review.googlesource.com/c/sdk/+/182365 I fixed a minor null safety bug in the code generation logic in pkg/analyzer/tool/messages/generate.dart (which generates pkg/analyzer/lib/src/dart/error/syntactic_errors.g.dart). The generated file had been updated in a previous CL, but no corresponding change had been made in the code generator. Normally we have a unit test to verify that the output of a code generator matches the corresponding generated file, so that we don't forget to do updates like this one. It looks like we don't have a unit test for syntactic_errors.g.dart.

stereotype441 commented 2 years ago

I just noticed that this file has been out of date for nearly 6 months (https://dart-review.googlesource.com/c/sdk/+/190881 updated it, but then a later patchset was uploaded that tweaked the error message text, and the code generator was not re-run).

I'll take responsibility for updating the generated file and adding a test to ensure it stays updated.