diff options
| author | historia <[not public]> | 2026-10-05 17:39:06 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-05 17:39:06 -0400 |
| commit | ec703a39738fefb60817f5659f76f8e683f8d301 (patch) | |
| tree | 00d1242d9f94bc2fec48331d8c02909be6b37f7a /internal/validate/correct_audit_fixes_test.go | |
| parent | 516fd29da423432ef6dfded21a984f1d15dcab1a (diff) | |
| download | thehouseoficarus-ec703a39738fefb60817f5659f76f8e683f8d301.tar.gz | |
fix: admin undo/redo failure, video poker cabinet ids, room ref behavior
Diffstat (limited to 'internal/validate/correct_audit_fixes_test.go')
| -rw-r--r-- | internal/validate/correct_audit_fixes_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/internal/validate/correct_audit_fixes_test.go b/internal/validate/correct_audit_fixes_test.go index 8ed6f52..f11dd3f 100644 --- a/internal/validate/correct_audit_fixes_test.go +++ b/internal/validate/correct_audit_fixes_test.go @@ -31,3 +31,19 @@ func TestValidateTalkConfigRequiresStartNode(t *testing.T) { } } } + +// Regression: a gather drop with weight <= 0 can never be selected (the +// weighted roll has zero total); it must be flagged. +func TestValidateGatherWarnsOnWeightlessDrop(t *testing.T) { + cfg := &behavior.GatherConfig{Drops: []behavior.DropEntry{{ItemID: "ore", Weight: 0}}} + issues := validateGather("test", cfg, map[string]bool{"ore": true}, map[string]bool{}) + found := false + for _, iss := range issues { + if strings.Contains(iss.Message, "weight") { + found = true + } + } + if !found { + t.Fatalf("weightless drop not warned: %+v", issues) + } +} |
