Fix stale tag considerations
This commit is contained in:
@@ -6526,6 +6526,53 @@ func TestUpdateOverrideRowKeyRetiresOldKeyEvenIfReferenced(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestUpdateOverrideRowKeyDoesNotDeleteRelocatedReplacementLock(t *testing.T) {
|
||||
row := map[string]any{"id": 58, "key": "baseitems:shortspear"}
|
||||
rowByKey := map[string]map[string]any{
|
||||
"baseitems:shortspear": row,
|
||||
}
|
||||
lockData := map[string]int{
|
||||
"baseitems:shortspear": 126,
|
||||
}
|
||||
expanded := map[string]any{
|
||||
"key": "baseitems:spear",
|
||||
}
|
||||
|
||||
changed, retiredKey, err := updateOverrideRowKey("baseitems", row, expanded, rowByKey, lockData)
|
||||
if err != nil {
|
||||
t.Fatalf("updateOverrideRowKey failed: %v", err)
|
||||
}
|
||||
if !changed {
|
||||
t.Fatal("expected key reassignment to mark the row changed")
|
||||
}
|
||||
if retiredKey != "baseitems:shortspear" {
|
||||
t.Fatalf("expected retired key baseitems:shortspear, got %q", retiredKey)
|
||||
}
|
||||
if lockData["baseitems:shortspear"] != 126 {
|
||||
t.Fatalf("expected relocated replacement lock to survive old row retirement, got %#v", lockData)
|
||||
}
|
||||
if lockData["baseitems:spear"] != 58 {
|
||||
t.Fatalf("expected new row key to lock to row 58, got %#v", lockData)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRetireRowIdentityDoesNotDeleteRelocatedReplacementLock(t *testing.T) {
|
||||
row := map[string]any{"id": 916, "key": "feat:skill_focus_intimidate"}
|
||||
lockData := map[string]int{
|
||||
"feat:skill_focus_intimidate": 1333,
|
||||
}
|
||||
retiredKeys := map[string]struct{}{}
|
||||
|
||||
retireRowIdentity(row, lockData, retiredKeys)
|
||||
|
||||
if lockData["feat:skill_focus_intimidate"] != 1333 {
|
||||
t.Fatalf("expected replacement lock to survive nulled old row, got %#v", lockData)
|
||||
}
|
||||
if _, ok := retiredKeys["feat:skill_focus_intimidate"]; !ok {
|
||||
t.Fatalf("expected old row key to be recorded as retired")
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildPrunesLockedIDThatTargetsManualBaseSpace(t *testing.T) {
|
||||
root := testProjectRoot(t)
|
||||
mkdirAll(t, filepath.Join(root, "topdata", "data", "dense", "modules"))
|
||||
|
||||
Reference in New Issue
Block a user