Close out the D&D combat turn extraction roadmap
This commit is contained in:
@@ -125,6 +125,33 @@ func TestProductionCombatPipelineRetriesMergesNormalizesAndWritesJSON(t *testing
|
||||
}
|
||||
}
|
||||
|
||||
func TestCombatNormalizerRejectsCampaignReferenceBinding(t *testing.T) {
|
||||
registries := productionNPCRegistries(t)
|
||||
catalog := moduleCatalog(registries)
|
||||
referencePath := filepath.Join(t.TempDir(), "party.yml")
|
||||
if err := os.WriteFile(referencePath, []byte("Aria: cleric\n"), 0o600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
effective, err := combatOnlyConfig().Resolve(config.ResolveInput{
|
||||
PipelineID: "dnd-combat-fixture",
|
||||
Catalog: catalog,
|
||||
ReferenceOverrides: []pipeline.ReferenceBinding{{
|
||||
Stage: pipeline.StageNormalize, LaneID: "combat", SlotName: "party", Source: referencePath,
|
||||
BindingSource: contracts.ReferenceBindingSourceCLI,
|
||||
}},
|
||||
})
|
||||
if err != nil {
|
||||
if !strings.Contains(err.Error(), "party") {
|
||||
t.Fatalf("Resolve() error = %v, want undeclared party context", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
_, _, err = pipeline.MaterializeReferences(effective.ResolvedPipeline, catalog, pipeline.ReferenceMaterializationOptions{})
|
||||
if err == nil || !strings.Contains(err.Error(), "party") || !strings.Contains(err.Error(), "not declared") {
|
||||
t.Fatalf("MaterializeReferences() error = %v, want undeclared normalize party binding", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSequentialNPCOutputGroundsCombatAtBothStageLocalReferences(t *testing.T) {
|
||||
registries := productionNPCRegistries(t)
|
||||
catalog := moduleCatalog(registries)
|
||||
|
||||
Reference in New Issue
Block a user