Classify remaining D&D producer diagnostics
This commit is contained in:
@@ -92,3 +92,21 @@ func TestCollectGroupsNormalizationFindingsWithBoundedSamples(t *testing.T) {
|
||||
t.Fatalf("diagnostic = %#v", diagnostic)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNormalizationDiagnosticsCombinesQualityAndCleanupWithoutWarnings(t *testing.T) {
|
||||
groups, err := NormalizationDiagnostics([]contracts.Warning{
|
||||
{Scope: "spell_casts[0]", ReasonCode: "spell_name_canonicalized", Message: "canonicalized spell name"},
|
||||
{Scope: "spell_casts[1]", ReasonCode: "spell_name_unresolved", Message: "spell was not in the catalog"},
|
||||
}, "spell_name_unresolved")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(groups) != 2 || groups[0].Disposition != contracts.DiagnosticDispositionObservation || groups[1].Disposition != contracts.DiagnosticDispositionAdvisory {
|
||||
t.Fatalf("groups = %#v, want cleanup observation and quality advisory", groups)
|
||||
}
|
||||
for _, group := range groups {
|
||||
if group.Disposition == contracts.DiagnosticDispositionWarning {
|
||||
t.Fatalf("groups = %#v, want zero warning groups", groups)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user