From c5defc9b341d537c04f2faee25abe8c11561ab25 Mon Sep 17 00:00:00 2001 From: prosolis <5590409+prosolis@users.noreply.github.com> Date: Fri, 8 May 2026 15:04:54 -0700 Subject: [PATCH] Adv 2.0 D&D Phase 11 D11: GMNarrationType coverage test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lock in the D6 audit conclusion that every GMNarrationType routes to a non-empty pool for every registered zone. New zones or types added without wiring their pool now fail TestNarrationCoverage_AllZonesAllTypes instead of silently rendering "". Audit confirmed all 12 types × 10 zones already covered (per-zone pools where they exist, generic fallback otherwise) — no flavor written. Co-Authored-By: Claude Opus 4.7 (1M context) --- internal/plugin/dnd_zone_cmd_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/internal/plugin/dnd_zone_cmd_test.go b/internal/plugin/dnd_zone_cmd_test.go index 8214722..15c201b 100644 --- a/internal/plugin/dnd_zone_cmd_test.go +++ b/internal/plugin/dnd_zone_cmd_test.go @@ -391,3 +391,23 @@ func TestRenderZoneMap_Empty(t *testing.T) { t.Errorf("empty seq: got %q", got) } } + +// TestNarrationCoverage_AllZonesAllTypes — D6 polish guarantee. Locks in +// that every GMNarrationType resolves to a non-empty pool for every +// registered zone. Adding a new zone or new GMNarrationType without +// wiring its pool will fail this test. +func TestNarrationCoverage_AllZonesAllTypes(t *testing.T) { + types := []GMNarrationType{ + GMRoomEntry, GMCombatStart, GMCombatEnd, GMNat20, GMNat1, + GMBossEntry, GMBossDeath, GMPlayerDeath, GMZoneComplete, + GMTrapDetected, GMTrapTripped, GMLore, + } + for _, z := range allZones() { + for _, k := range types { + pool := pickPool(z.ID, k) + if len(pool) == 0 { + t.Errorf("zone %s × %s: empty pool — every (zone, type) must route to prewritten flavor", z.ID, k) + } + } + } +}