package replays import ( "regexp" "testing" ) // Every replay says what happened, what it asserts, where its fix is, and how it is run. func TestEveryReplayIsWhole(t *testing.T) { seen := map[string]bool{} for _, r := range Register { if seen[r.ID] { t.Errorf("%s is registered twice", r.ID) } seen[r.ID] = true if r.Issue == 0 || r.What == "" || r.Asserts == "" || r.Repository == "" || r.Fix == "" || r.Test == "" { t.Errorf("%s does not say its incident, its outcome, its fix and its test: %+v", r.ID, r) } if !regexp.MustCompile(`^R\d+$`).MatchString(r.ID) { t.Errorf("%q is not a replay's id", r.ID) } switch r.Kind { case InRepository, Gate: if len(r.Files) == 0 || r.Package == "" { t.Errorf("%s runs in its repository and lays no files over the commit", r.ID) } case Bus, Resolver: default: t.Errorf("%s is of no kind the prover runs: %q", r.ID, r.Kind) } } for _, issue := range []string{"236", "262", "263", "266"} { if _, ok := Find(issue); !ok { t.Errorf("to-be 45 Phase 5 is done when the replay of %s fails before its fix and passes after; it has none", issue) } } }