Migrate examples and guidance to shared domain inputs
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/core/config"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/contracts"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/pipeline"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/integrations/domainrefs"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/dnd"
|
||||
locationoccurrenceextract "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/extract/locationoccurrences"
|
||||
locationextract "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/extract/locationregistry"
|
||||
@@ -123,6 +124,25 @@ func TestMaintainedExamplesResolveComposition(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestMaintainedSharedReferencesConform(t *testing.T) {
|
||||
for _, item := range []struct {
|
||||
name string
|
||||
validate func(map[string]any) error
|
||||
}{
|
||||
{"party.yml", domainrefs.ValidateParty},
|
||||
{"glossary.yml", domainrefs.ValidateGlossary},
|
||||
} {
|
||||
content := readRepositoryFile(t, "examples", "dnd-complete", item.name)
|
||||
doc, err := domainrefs.Load(item.name, "application/yaml", content)
|
||||
if err == nil {
|
||||
err = item.validate(doc)
|
||||
}
|
||||
if err != nil {
|
||||
t.Fatalf("%s: %v", item.name, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestMaintainedExampleDevelopmentInheritsComposition(t *testing.T) {
|
||||
path := repositoryPath("examples", "dnd-complete", "config.yml")
|
||||
cfg := loadMaintainedExample(t, path)
|
||||
@@ -427,10 +447,10 @@ func TestCompleteDNDSharedCLIReferencesExpandAcrossCompatibleTargets(t *testing.
|
||||
cfg := loadMaintainedExample(t, repositoryPath("examples", "dnd-complete", "config.yml"))
|
||||
catalog := catalogFromRegistries(productionTestComponents(t).registries)
|
||||
sources := map[string]string{
|
||||
"party": "/references/party.txt",
|
||||
"party": "/references/party.yml",
|
||||
"players": "/references/players.txt",
|
||||
"glossary": "/references/glossary.txt",
|
||||
"spell_catalog": "/references/spells.json",
|
||||
"glossary": "/references/glossary.yml",
|
||||
"spell_catalog": "/references/glossary.yml",
|
||||
}
|
||||
requests := make([]cliReferenceRequest, 0, len(sources))
|
||||
for _, slot := range []string{"party", "players", "glossary", "spell_catalog"} {
|
||||
|
||||
Reference in New Issue
Block a user