Add diagnostic coverage, remove possibly-unreachable unary op diagnostic (#4519)

I'm working to make sure remaining diagnostics have coverage, at least
the ones I'd previously added a TODO for. Note in particular that I
couldn't figure out a repro for UnaryOperatorRequiresWhitespace; if you
have one, I can add a test, but otherwise maybe it's actually
unreachable due to being diagnosed through infix logic (or, maybe
this'll let fuzzing tell me an example).
This commit is contained in:
Jon Ross-Perkins
2024-11-13 18:04:25 +00:00
committed by GitHub
parent 3ba4997855
commit fa95892a37
10 changed files with 478 additions and 43 deletions
+4 -20
View File
@@ -33,30 +33,14 @@ constexpr DiagnosticKind UntestedDiagnosticKinds[] = {
// should be tested.
DiagnosticKind::ArrayBoundTooLarge,
// This isn't feasible to test with a normal testcase, but is tested in
// These aren't feasible to test with a normal testcase, but are tested in
// lex/tokenized_buffer_test.cpp.
DiagnosticKind::TooManyTokens,
// TODO: Should look closer at these, but adding tests is a high risk of
// loss in merge conflicts due to the amount of tests being changed right
// now.
DiagnosticKind::ExternLibraryInImporter,
DiagnosticKind::ExternLibraryOnDefinition,
DiagnosticKind::HexadecimalEscapeMissingDigits,
DiagnosticKind::IncompleteTypeInFunctionParam,
DiagnosticKind::InvalidDigit,
DiagnosticKind::InvalidDigitSeparator,
DiagnosticKind::InvalidHorizontalWhitespaceInString,
DiagnosticKind::MismatchedIndentInString,
DiagnosticKind::ModifierPrivateNotAllowed,
DiagnosticKind::MultiLineStringWithDoubleQuotes,
DiagnosticKind::TooManyDigits,
DiagnosticKind::UnaryOperatorRequiresWhitespace,
DiagnosticKind::UnicodeEscapeSurrogate,
DiagnosticKind::UnicodeEscapeTooLarge,
DiagnosticKind::UnknownBaseSpecifier,
DiagnosticKind::UnsupportedCRLineEnding,
DiagnosticKind::UnsupportedLFCRLineEnding,
// This is a little long but is tested in lex/numeric_literal_test.cpp.
DiagnosticKind::TooManyDigits,
};
// Looks for diagnostic kinds that aren't covered by a file_test.