diff options
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) + } +} |
