Harden diagnostic handling and warning presentation
This commit is contained in:
@@ -15,10 +15,10 @@ type normalizerFixtureSet struct {
|
||||
}
|
||||
|
||||
type normalizerFixtureCase struct {
|
||||
Name string `json:"name"`
|
||||
Input dnd.SpellList `json:"input"`
|
||||
Output dnd.SpellList `json:"output"`
|
||||
WarningReasonCodes []string `json:"warning_reason_codes"`
|
||||
Name string `json:"name"`
|
||||
Input dnd.SpellList `json:"input"`
|
||||
Output dnd.SpellList `json:"output"`
|
||||
DiagnosticReasonCodes []string `json:"diagnostic_reason_codes"`
|
||||
}
|
||||
|
||||
func TestNormalizeAcceptedFixtures(t *testing.T) {
|
||||
@@ -48,8 +48,8 @@ func TestNormalizeAcceptedFixtures(t *testing.T) {
|
||||
for _, diagnostic := range result.Diagnostics {
|
||||
gotReasonCodes = append(gotReasonCodes, diagnostic.ReasonCode)
|
||||
}
|
||||
if !reflect.DeepEqual(gotReasonCodes, fixture.WarningReasonCodes) {
|
||||
t.Fatalf("warning reason codes = %#v, want %#v", gotReasonCodes, fixture.WarningReasonCodes)
|
||||
if !reflect.DeepEqual(gotReasonCodes, fixture.DiagnosticReasonCodes) {
|
||||
t.Fatalf("diagnostic reason codes = %#v, want %#v", gotReasonCodes, fixture.DiagnosticReasonCodes)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user