package catalogue import ( "strings" "testing" ) // 1887/A9b: the build queue's verbs are refused by name, naming what replaced them, and the verbs R4e removed are gone. func TestTheBuildQueueVerbsAreRefusedByName(t *testing.T) { rows := map[string]Verb{} for _, v := range ControllerVerbs { rows[v.Name] = v } for _, gone := range []string{"rebuild", "forget-checks"} { if _, ok := rows[gone]; ok { t.Errorf("the controller still lists %s", gone) } } for _, refused := range []string{"queue", "cancel", "clear", "kill", "pause", "resume", "replay"} { v, ok := rows[refused] if !ok || !strings.HasPrefix(v.Description, "Removed in R4g (ADR 0525 ยง9): refused by name") { t.Errorf("%s = %q, want refused by name", refused, v.Description) } } if !strings.Contains(rows["queue"].Description, "delivery view") || !strings.Contains(rows["pause"].Description, "node-build-") { t.Errorf("queue and pause do not name their replacements: %q, %q", rows["queue"].Description, rows["pause"].Description) } if strings.Contains(rows["try"].Description, "build-agent") { t.Errorf("try still names build-agent: %q", rows["try"].Description) } }