mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-16 04:12:03 +00:00
feat: classify match integrity separately from delivery
This commit is contained in:
@@ -94,3 +94,20 @@ func TestResultDeliveryHealthSeparatesOutageFromIntegrity(t *testing.T) {
|
||||
t.Fatalf("committed delivery status = %+v err=%v", committed, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIntegrityClassifierDoesNotSuppressHealthyResultForDeliveryOutage(t *testing.T) {
|
||||
healthy := IntegrityEvidence{RosterAuthoritative: true, SimulationAuthoritative: true, ResultAuthoritative: true, RegionalPlayFair: true, DeliveryAvailable: false}
|
||||
if got := ClassifyIntegrity(healthy); got != IntegrityCertified {
|
||||
t.Fatalf("delivery outage changed integrity: %s", got)
|
||||
}
|
||||
for _, evidence := range []IntegrityEvidence{
|
||||
{SimulationAuthoritative: true, ResultAuthoritative: true, RegionalPlayFair: true},
|
||||
{RosterAuthoritative: true, ResultAuthoritative: true, RegionalPlayFair: true},
|
||||
{RosterAuthoritative: true, SimulationAuthoritative: true, RegionalPlayFair: true},
|
||||
{RosterAuthoritative: true, SimulationAuthoritative: true, ResultAuthoritative: true},
|
||||
} {
|
||||
if got := ClassifyIntegrity(evidence); got != IntegritySuppressed {
|
||||
t.Fatalf("incomplete integrity was certified: %+v -> %s", evidence, got)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user