From 19a7128ec67dffe48ab4315ddfe4c80e71baecd2 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Tue, 20 Oct 2026 01:25:25 +0200 Subject: [PATCH] fix: compare md5 when keeping Recalbox text The attribute pattern took letters only, so md5 never entered the comparison and an element whose digest the truth corrects kept Recalbox's text. A test written before the change caught it. The RetroDECK fixture now names the core that reads its addition, as the placement rule requires. --- scripts/exporter/recalbox_exporter.py | 2 +- tests/test_export_counts.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/exporter/recalbox_exporter.py b/scripts/exporter/recalbox_exporter.py index 9f1d9ca1..58b75a56 100644 --- a/scripts/exporter/recalbox_exporter.py +++ b/scripts/exporter/recalbox_exporter.py @@ -35,7 +35,7 @@ SCHEMA_URL = ( ) -_ATTRIBUTE = re.compile(r'([A-Za-z]+)\s*=\s*"([^"]*)"') +_ATTRIBUTE = re.compile(r'([A-Za-z][A-Za-z0-9]*)\s*=\s*"([^"]*)"') _SYSTEM_BLOCK = re.compile(r"", re.S) _BIOS_ELEMENT = re.compile(r"[ \t]*", re.S) diff --git a/tests/test_export_counts.py b/tests/test_export_counts.py index bf3bc04b..5163cbe3 100644 --- a/tests/test_export_counts.py +++ b/tests/test_export_counts.py @@ -128,7 +128,8 @@ class RetroDeckWritesWhatItCounts(unittest.TestCase): def test_addition_goes_to_the_system_component(self): declared = NativeFile("a.bin", "bios/a.bin", "psx", platform={"component": "duckstation", "md5": A}) - added = NativeFile("b.bin", "bios/b.bin", "psx", truth={"md5": B}) + added = NativeFile("b.bin", "bios/b.bin", "psx", truth={"md5": B}, + runners=[(True, "duckstation")]) spread = NativeSystem("amiga", files=[ NativeFile("k1", "bios/k1", "amiga", platform={"component": "retroarch"}), NativeFile("k2", "bios/k2", "amiga", platform={"component": "puae"}),