The node-engine's seat reader reads invokes in both forms and refuses a form it cannot read
Builds: design 47 G A-275, §558 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -2,9 +2,11 @@ package selfcompose
|
||||
|
||||
import (
|
||||
"context"
|
||||
"slices"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog"
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshwants"
|
||||
)
|
||||
|
||||
@@ -33,3 +35,20 @@ func TestTheKeepingNodeIsTheWantsKeptOn(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Design 47 G §558, A-275: a manifest's `invokes` in its long form {verb, fields} is read for its seat, and one of a form that
|
||||
// cannot be read is refused, never read as no seats.
|
||||
func TestSeatsOfReadsALongFormInvokeAndRefusesAnUnreadableOne(t *testing.T) {
|
||||
c := New(Env{Node: "n1"})
|
||||
c.modules["m"] = meshcatalog.ModulesByModuleValue{Manifest: "d1"}
|
||||
c.modules["bad"] = meshcatalog.ModulesByModuleValue{Manifest: "d2"}
|
||||
c.manifests["d1"] = []byte(`{"module":"m","invokes":["seat:a.b",{"verb":"seat:mesh-catalog.revision","fields":["x"]}]}`)
|
||||
c.manifests["d2"] = []byte(`{"module":"bad","invokes":[3]}`)
|
||||
seats, err := c.seatsOf(context.Background(), reader{c: c}, "m")
|
||||
if err != nil || !slices.Equal(seats, []string{"a", "mesh-catalog"}) {
|
||||
t.Fatalf("seats %v, %v", seats, err)
|
||||
}
|
||||
if seats, err := c.seatsOf(context.Background(), reader{c: c}, "bad"); err == nil {
|
||||
t.Fatalf("an unreadable invokes gave seats %v", seats)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user