Files
mesh-sdk/go/catalogue/delivery_seat_test.go
T
jschoubben 66ad4956d5 D-4, D-5, D-6: the bootstrapped and test seat definitions are the contracts' files at milestone G's heads
The catalogue's tests of the retired delivery verbs go with them.

Builds: design 47 G §203, §309, §365, §302, §337, §336, §389, §390, §83, §307, §308, §260, §349, §375
Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
2026-11-11 11:27:05 +01:00

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)
}
}
}