Files
mesh-delivery/modules/mesh-grants/internal/grants/wantedkeep_test.go
T
jschoubben 71a35a6376 MV1: move contracts and sdk under modules/, importers follow
The delivery repository's contracts and SDK live under modules/ as
mesh-delivery-contracts and mesh-delivery-sdk, their Go module paths
renamed to match the folders (the TypeScript names already did), and
every importer in mesh-delivery, mesh-catalog, mesh-host, mesh-tools
and mesh-sdk follows in the same group: a design as it should be, one
path per module, checked by the group's check building every importer.

Builds: design 47 G §427, §88

Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
2026-11-12 05:09:56 +01:00

33 lines
909 B
Go

package grants
import (
"os"
"path/filepath"
"testing"
"git.novox.be/novox/mesh-sdk/go/seatdef"
)
// Design 47 G A-114 (§693, A-61): the seat mesh-wants' `wanted` stream keeps the last message of each subject with no age
// limit, so each want's last word is read whole at a start.
func TestWantedKeepsEachWantsLastWordWithNoAgeLimit(t *testing.T) {
raw, err := os.ReadFile(filepath.Join("..", "..", "..", "mesh-delivery-contracts", "seats", "mesh-wants", "seat.json"))
if err != nil {
t.Fatal(err)
}
d, err := seatdef.Parse(raw)
if err != nil {
t.Fatal(err)
}
for _, e := range d.Events {
if e.Name != "wanted" {
continue
}
if !e.KeptLastPerSubject() || e.KeptAgeDays() != 0 {
t.Errorf("wanted keeps last-per-subject %v for %d days, want true and 0 (no age limit)", e.KeptLastPerSubject(), e.KeptAgeDays())
}
return
}
t.Fatal("the seat mesh-wants has no event wanted")
}