The controller ended by its unassignment (ADR 0590), so its seat, the grants seat's lease write and hand-back and placement's take-over from it serve nothing. The dependence check becomes strict (clause 5): a read of the lease, a claim, a require or the module itself is refused like any other declaration. held and artifacts-gone are the artifact sweep seat's (ADR 0571 §2). Issue 1126 B1, B2. Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
52 lines
2.1 KiB
Go
52 lines
2.1 KiB
Go
package catalogue
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
// 1943/AC4: the delivery seat keeps the merge's verbs and no longer offers times, what-if, release, stop or
|
|
// retire-history: each is a row with no input, optional so the holder of before and the holder of release 6 both hold
|
|
// the seat, refusing it by name; mark-ready, served by nobody since issue 1022, is gone.
|
|
func TestTheDeliverySeatHasNoPlanVerbs(t *testing.T) {
|
|
seat, ok := SeatNamed(DeliverySeat)
|
|
if !ok {
|
|
t.Fatal("the delivery seat is not in the set")
|
|
}
|
|
rows := map[string]Verb{}
|
|
for _, v := range seat.Serves {
|
|
rows[v.Name] = v
|
|
}
|
|
for _, name := range []string{"times", "what-if", "release", "stop", "retire-history"} {
|
|
v, ok := rows[name]
|
|
replacement, removed := RemovedDeliveryVerbs[name]
|
|
if !ok || !removed || replacement == "" {
|
|
t.Errorf("%s: in the table %v, in the removed list %v", name, ok, removed)
|
|
continue
|
|
}
|
|
if !strings.HasPrefix(v.Description, "Removed in R6 (ADR 0539): refused by name") || !strings.Contains(v.Description, replacement) || !v.Optional {
|
|
t.Errorf("%s = %q (optional %v), want an optional row refusing it by name", name, v.Description, v.Optional)
|
|
}
|
|
if props, _ := v.Input["properties"].(map[string]any); len(props) > 0 {
|
|
t.Errorf("%s still takes %v", name, props)
|
|
}
|
|
}
|
|
if _, ok := rows["mark-ready"]; ok {
|
|
t.Errorf("mark-ready is still promised")
|
|
}
|
|
for _, kept := range []string{"deliveries", "show", "groups", "checks", "table", "recheck", "close", "stalled", "settle"} {
|
|
if v, ok := rows[kept]; !ok || strings.HasPrefix(v.Description, "Removed") {
|
|
t.Errorf("%s is not kept (ADR 0539 clause 17)", kept)
|
|
}
|
|
}
|
|
gate := Manifest{Module: "mesh-delivery", Claims: []Claim{{Name: DeliverySeat, Scope: ScopeMesh,
|
|
Serves: []string{"deliveries", "show", "groups", "checks", "table", "stalled", "recheck", "close"}}}}
|
|
if err := CanHold(gate, seat); err != nil {
|
|
t.Errorf("the gate of release 6 cannot hold the seat: %v", err)
|
|
}
|
|
gate.Claims[0].Serves = append(gate.Claims[0].Serves, "times", "what-if", "release", "stop", "retire-history")
|
|
if err := CanHold(gate, seat); err != nil {
|
|
t.Errorf("the gate of release 5 cannot hold the seat: %v", err)
|
|
}
|
|
}
|