37 lines
1.5 KiB
Go
37 lines
1.5 KiB
Go
package catalogue
|
|
|
|
import (
|
|
"slices"
|
|
"testing"
|
|
)
|
|
|
|
// **R298 — a seat's new verb lands in either repository first** (novox/hq issue 298). On 2026-10-07 the
|
|
// delivery seat gained `checks`: the seat is defined here and held by a module in the catalogue, and
|
|
// neither could merge first — a controller promising the verb refused the holder that did not serve it
|
|
// yet, and a holder serving it was refused by the controller that did not promise it. The outcome
|
|
// asserted: the holder as it was, and the holder serving `checks` too, both hold the delivery seat.
|
|
//
|
|
// Written only with what the catalogue package had before the fix (SeatNamed, VerbNames, CanHold), so the
|
|
// prover can lay it over that commit.
|
|
func TestReplay298ADeliverySeatHolderHoldsBeforeAndAfterItServesChecks(t *testing.T) {
|
|
seat, ok := SeatNamed(DeliverySeat)
|
|
if !ok {
|
|
t.Fatal("the delivery seat is not in the set")
|
|
}
|
|
var before []string
|
|
for _, v := range VerbNames(seat.Serves) {
|
|
if v != "checks" {
|
|
before = append(before, v)
|
|
}
|
|
}
|
|
holder := func(serves []string) Manifest {
|
|
return Manifest{Module: "mesh-delivery", Claims: []Claim{{Name: DeliverySeat, Scope: ScopeMesh, Serves: serves}}}
|
|
}
|
|
if err := CanHold(holder(before), seat); err != nil {
|
|
t.Fatalf("the holder as the catalogue had it, before it serves checks, is refused: %v", err)
|
|
}
|
|
if err := CanHold(holder(append(slices.Clone(before), "checks")), seat); err != nil {
|
|
t.Fatalf("the holder serving checks is refused — the catalogue cannot merge first: %v", err)
|
|
}
|
|
}
|