Add a test that checks coverage of diagnostics
I think we should have a test, of a similar vein to the lint-notes
test, which keeps track of which error message constructors we end up encountering when running the testsuite.
The test should thus output a text file, e.g. diagnostic-coverage.stdout
, which would list all error constructors that are missing a test case. This would help catch the situation of adding a new error without a corresponding test, and would allow us to keep track of potentially dead error messages.
I'm not sure how this would achieved, but one possible avenue would be to search through the stdout
of other tests and see which diagnostic codes are emitted.