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