Prepare structured D&D reference context

This commit is contained in:
2026-11-29 18:09:09 +00:00
parent f84e737b2a
commit e0554209f0
22 changed files with 465 additions and 65 deletions

View File

@@ -10,6 +10,15 @@ import (
"gitea.maximumdirect.net/eric/notarius/internal/modules/dnd"
)
func TestConstructionRejectsInvalidPartyReference(t *testing.T) {
refs := contracts.ReferenceSet{Slots: map[string]contracts.ResolvedReferenceSlot{
"party": {Items: []contracts.ReferenceItem{{MediaType: "application/json", Content: []byte("{}")}}},
}}
if _, err := New(Options{}, refs); err == nil {
t.Fatal("invalid party accepted during construction")
}
}
func TestModuleRegistrationAndNativeDependencies(t *testing.T) {
if _, err := New(Options{}, contracts.ReferenceSet{}, contracts.ReferenceSet{}); err == nil || !strings.Contains(err.Error(), "at most one") {
t.Fatalf("New() error = %v, want reference-set rejection", err)