From 3bd19b9e97d7fc3a0cd6a272ba2ddd3e4ad5e532 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Tue, 6 Oct 2026 01:48:17 +0200 Subject: [PATCH] test: fail, not skip, when slot conflicts vanish --- tests/test_slot.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tests/test_slot.py b/tests/test_slot.py index ca4a6d78..9cd29878 100644 --- a/tests/test_slot.py +++ b/tests/test_slot.py @@ -204,14 +204,32 @@ class TestRepoProfiles(unittest.TestCase): entry = index.get(name) if entry is None: self.skipTest(f"{name} not in any profile") - if not index["scph1001.bin"].get("conflict"): - self.skipTest("no conflicting ranks declared yet") + # pcsx1 and DuckStation both rank these and disagree: losing the mark + # is the failure this test exists for, not a reason to skip it. + self.assertTrue(index["scph1001.bin"].get("conflict")) drops, _u = slot.resolve_slot_drops( {"psx": _pairs("scph1001.bin", "scph5501.bin", "scph7001.bin")}, index, ) self.assertEqual(drops & {"scph1001.bin", "scph5501.bin"}, set()) + def test_opposite_orders_mark_a_conflict(self): + """Two cores ranking the same files in opposite orders drop nothing.""" + profiles = { + "a": {"files": [ + {"name": "x.bin", "system": "s", "priority": 1}, + {"name": "y.bin", "system": "s", "priority": 2}, + ]}, + "b": {"files": [ + {"name": "x.bin", "system": "s", "priority": 2}, + {"name": "y.bin", "system": "s", "priority": 1}, + ]}, + } + index = slot.build_slot_index(profiles) + self.assertTrue(index["x.bin"].get("conflict") or index["y.bin"].get("conflict")) + drops, _u = slot.resolve_slot_drops({"s": _pairs("x.bin", "y.bin")}, index) + self.assertEqual(drops, set()) + def test_numero_search_order_decides_its_slot(self): """numero is alone on ti-83 and ranks all three ROMs, so this is the one slot the repo can currently decide end to end."""