package verify import ( "encoding/json" "testing" ) // TestOneSourceIsAWarningNotARefusal: the forked chain has one public indexer today. The verdict // must say so plainly and still let the caller proceed, because the alternative is a product that // pretends it has three sources when it has one. func TestOneSourceIsAWarningNotARefusal(t *testing.T) { body := oneSourceDossier(t) out, err := AdjudicateJSON(body) if err != nil { t.Fatal(err) } var report Report if err := json.Unmarshal(out, &report); err != nil { t.Fatal(err) } if report.Verdict != VerdictWarn { failed, unverifiable := report.Unverified() for _, check := range append(failed, unverifiable...) { t.Logf("%s: %s", check.Name, check.Detail) } t.Fatalf("verdict %s, want warn", report.Verdict) } if err := report.Gate(); err != nil { t.Fatalf("a warning blocked the gate: %v", err) } found := false for _, check := range report.Checks { if check.Name == "source_independence" && check.Status == Warn { found = true } } if !found { t.Fatal("the single source was not reported as a warning") } }