Fix tail rows in portrait generation

This commit is contained in:
2026-05-25 10:06:40 +02:00
parent 01ddcf8735
commit e6fffdf041
4 changed files with 24 additions and 7 deletions
+7 -3
View File
@@ -657,14 +657,16 @@ func TestBuildNativeAllocatesConfiguredDatasetsIntoFirstNullBaseRows(t *testing.
{"id": 0, "key": "portraits:none", "BaseResRef": "****", "Sex": 4},
{"id": 1, "BaseResRef": "****", "Sex": "****"},
{"id": 2, "BaseResRef": null, "Sex": null},
{"id": 3, "key": "portraits:existing", "BaseResRef": "existing_", "Sex": 1}
{"id": 3, "key": "portraits:existing", "BaseResRef": "existing_", "Sex": 1},
{"id": 4, "BaseResRef": "****", "Sex": "****"},
{"id": 5, "BaseResRef": "****", "Sex": "****"}
]
}`+"\n")
writeFile(t, filepath.Join(root, "topdata", "data", "portraits", "lock.json"), `{
"portraits:none": 0,
"portraits:existing": 3,
"portraits:first": 4,
"portraits:second": 5
"portraits:first": 6,
"portraits:second": 7
}`+"\n")
writeFile(t, filepath.Join(root, "topdata", "data", "portraits", "modules", "custom.json"), `{
"entries": {
@@ -698,6 +700,8 @@ func TestBuildNativeAllocatesConfiguredDatasetsIntoFirstNullBaseRows(t *testing.
for _, want := range []string{
"1\tfirst_\t4",
"2\tsecond_\t4",
"4\t****\t****",
"5\t****\t****",
} {
if !strings.Contains(output, want) {
t.Fatalf("expected generated portraits row %q, got:\n%s", want, output)