refactor: one bounded join for pack file names

bounded_pack_name repeated bounded_join with another joiner and budget, and md5pack hashed its selection inline. bounded_join takes joiner, budget and suffix, selection_digest serves all three; emulator packs keep the '_' joiner, so no name changes.
This commit is contained in:
Abdessamad Derraz committed 2026-11-21 06:02:28 +01:00
1 parent f5946a7845
commit fb17242a78
4 files changed
+32 -31

No files matched your search

+4 -1
View File
@@ -3406,7 +3406,10 @@ class APackNameFitsAFileName(unittest.TestCase):
before writing anything, while verify --system snes reported."""
def test_a_long_selection_is_bounded_and_told_apart(self):
from scripts.packs.naming import MAX_PACK_NAME_BYTES, bounded_pack_name
from scripts.packs.naming import MAX_PACK_NAME_BYTES, bounded_join
def bounded_pack_name(display: list[str], keys: list[str], suffix: str) -> str:
return bounded_join(display, keys, joiner="_", budget=MAX_PACK_NAME_BYTES, suffix=suffix)
names = [f"Emulator_Number_{i}" for i in range(23)]
long_name = bounded_pack_name(names, names, "_BIOS_Pack.zip")