review: require .2da suffix on race feats tables, shrink rule test compare
ci / ci (pull_request) Successful in 3m28s
build-binaries / build-binaries (push) Canceled after 0s

Review of #94 branch: tighten racialUsableFeatRules to match the spec's
'race_feat_*.2da' (prefix alone would admit a non-2DA dataset), and
replace the test's length-check-plus-loop with one reflect.DeepEqual.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-03 20:46:19 +02:00
co-authored by Claude Fable 5
parent 4346e96b53
commit cbfce696b2
2 changed files with 4 additions and 8 deletions
+1 -1
View File
@@ -4154,7 +4154,7 @@ func racialUsableFeatRules(collected []nativeCollectedDataset) []project.TopData
seen := map[string]struct{}{}
rules := []project.TopDataClassFeatGlobalRule{}
for _, ds := range collected {
if !strings.HasPrefix(ds.Dataset.OutputName, "race_feat_") {
if !strings.HasPrefix(ds.Dataset.OutputName, "race_feat_") || !strings.HasSuffix(ds.Dataset.OutputName, ".2da") {
continue
}
for _, row := range ds.Rows {
+3 -7
View File
@@ -47,12 +47,8 @@ func TestRacialUsableFeatRules(t *testing.T) {
{Feat: "feat:tiefling/darkness", List: "3", GrantedOnLevel: "99", OnMenu: "1"},
}
if len(got) != len(want) {
t.Fatalf("rule count: got %d, want %d (%+v)", len(got), len(want), got)
}
for i := range want {
if !reflect.DeepEqual(got[i], want[i]) { // slice is sorted by Feat, so order is deterministic
t.Fatalf("rule %d: got %+v, want %+v", i, got[i], want[i])
}
// Slice is sorted by Feat, so order is deterministic.
if !reflect.DeepEqual(got, want) {
t.Fatalf("rules: got %+v, want %+v", got, want)
}
}