Main reverted G's half merge (#189, reverted by8afc3ebin #191) and then took the reader release's S1-S5, which copied G's code. G's form holds where they differ (process_bus.go, seats.go, state.go and their tests); the release's kept names stay so main's callers keep building: SeatViewPrefix beside SeatReadPrefix, and QueueInvoke's empty strings on not-ok (with its test TestQueueInvoke). The tree differs from G's headf30dee54only by those and the release's two tests (objects cap option, seat states and stream kinds). Builds: design 47 G (the milestone's sdk part, as atf30dee54) Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
23 lines
872 B
Go
23 lines
872 B
Go
package catalogue
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.novox.be/novox/mesh-sdk/go/seatdef"
|
|
)
|
|
|
|
// An event whose subject carries parts is said by its subject with `*` for each part, so a consumer naming one
|
|
// instance or every instance of it is heard as the seat's (design 47 *What each step says*).
|
|
func TestAnEventWithPartsIsTheSeatsByItsSubject(t *testing.T) {
|
|
s := SeatFromDefinition(seatdef.Definition{Seat: "mesh-delivery", Scope: "mesh", Events: []seatdef.Message{
|
|
{Name: "owed", Subject: "owed.<repository>.<number>"}, {Name: "pull.updated"}}})
|
|
for _, c := range []struct {
|
|
event string
|
|
says bool
|
|
}{{"owed.*.*", true}, {"owed.novox-mesh-sdk.12", true}, {"owed", false}, {"pull.updated", true}, {"pull.merged", false}} {
|
|
if got := SeatSays(s.Emits, c.event); got != c.says {
|
|
t.Errorf("%s: says %v, want %v (emits %v)", c.event, got, c.says, s.Emits)
|
|
}
|
|
}
|
|
}
|