Phase 5 is done when the replays of 236, 262, 263 and 266 fail on the commit before their fix and pass after. The register names every replay with its issue and fix; the bus replay (266) runs a consumer filtered like the controller's against a bus of a given release, the resolver replay (262) renders the catalogue's machine list and asks every machine's name by getaddrinfo under musl and glibc, and the prover runs each at both commits: all five (236, 262, 263, 266, 273) proved.
38 lines
1.1 KiB
Go
38 lines
1.1 KiB
Go
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)
|
|
}
|
|
}
|
|
}
|