From 6e77da4b823870aa9763ced17f75c252947fa65a Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:39:25 +0100 Subject: [PATCH] fix: write every platform count in the summary A platform with one entry had no number, so the named counts did not add up to the total (finding 81). --- scripts/verify.py | 3 +-- tests/test_audit_regressions.py | 2 +- tests/test_tool_messages.py | 14 +++++++++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/verify.py b/scripts/verify.py index 3c6fe1720..d740e96f2 100644 --- a/scripts/verify.py +++ b/scripts/verify.py @@ -2961,8 +2961,7 @@ def _overall_summary(group_results: list[tuple[dict, list[str]]]) -> str: platforms = sum(len(group) for _, group in group_results) def where(counts: dict[str, int]) -> str: - named = [f"{name} {count}" if count > 1 else name - for name, count in counts.items() if count] + named = [f"{name} {count}" for name, count in counts.items() if count] return f" ({', '.join(named)})" if named else "" parts = [] diff --git a/tests/test_audit_regressions.py b/tests/test_audit_regressions.py index 4f18a8ca8..3ece3f0a6 100644 --- a/tests/test_audit_regressions.py +++ b/tests/test_audit_regressions.py @@ -4830,7 +4830,7 @@ class VerifyAllSummaryNamesWhatIsWrong(unittest.TestCase): summary = verify._overall_summary( [(clean, ["RetroArch"]), (warned, ["RetroDECK"]), (core_miss, ["ROCKNIX"])] ) - self.assertIn("1 warning (RetroDECK)", summary) + self.assertIn("1 warning (RetroDECK 1)", summary) self.assertIn("ROCKNIX: n64.psh", summary) self.assertIn("0 critical,", summary) diff --git a/tests/test_tool_messages.py b/tests/test_tool_messages.py index adfcdd59d..1d97f3b7c 100644 --- a/tests/test_tool_messages.py +++ b/tests/test_tool_messages.py @@ -132,7 +132,7 @@ class TheVerifySummaryCountsDiscrepancies(unittest.TestCase): ({"severity_counts": {}, "details": details}, ["RetroArch"]), ({"severity_counts": {}, "details": []}, ["Batocera"]), ]) - self.assertIn("1 discrepancy (RetroArch)", summary) + self.assertIn("1 discrepancy (RetroArch 1)", summary) def test_a_shared_destination_names_the_path_and_both_sides(self): result = {"name": "disk.rom", "status": verify.Status.UNTESTED} @@ -145,6 +145,18 @@ class TheVerifySummaryCountsDiscrepancies(unittest.TestCase): self.assertIn(part, message) +class EveryPlatformInTheSummaryCarriesItsCount(unittest.TestCase): + """'17 discrepancies (Lakka 5, RetroArch 5, RetroBat 2, RetroDECK 4, + ROCKNIX)': the one platform with a single entry had no number, and the + named counts did not add up to the total.""" + + def test_a_count_of_one_is_written(self): + one = {"severity_counts": {verify.Severity.WARNING: 1}, "details": []} + two = {"severity_counts": {verify.Severity.WARNING: 2}, "details": []} + summary = verify._overall_summary([(two, ["Lakka"]), (one, ["ROCKNIX"])]) + self.assertIn("3 warning (Lakka 2, ROCKNIX 1)", summary) + + class OneSpellingPerOption(unittest.TestCase): """verify.py -p batocera worked and slots.py -p batocera was refused."""