From 1df23e3f7dd9712f83b5d162fa57099a598b870d Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Sun, 18 Oct 2026 05:19:31 +0200 Subject: [PATCH] fix: check verify applies the flags it accepts The mode and flag matrix only tests refusals, so a flag verify accepted and ignored, --verbose under --json, passed it. Each mode is now checked to change its output when that flag is given. --- tests/test_verify_listing.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_verify_listing.py b/tests/test_verify_listing.py index 95641bd2..1e78fec7 100644 --- a/tests/test_verify_listing.py +++ b/tests/test_verify_listing.py @@ -71,6 +71,20 @@ class VerifyRefusesWhatAModeDoesNotRead(unittest.TestCase): self.assertEqual(seen, ["elsewhere"]) +class VerifyAppliesWhatItAccepts(unittest.TestCase): + """--verbose under --json was accepted in every mode and changed nothing; + the refusal matrix above could not see it, since nothing was refused.""" + + def test_verbose_changes_the_json_in_every_mode(self): + for mode in (("--platform", "bizhawk"), ("--emulator", "handy"), + ("--system", "atari-lynx")): + with self.subTest(mode=mode): + plain = _run("scripts/verify.py", *mode, "--json") + verbose = _run("scripts/verify.py", *mode, "--json", "--verbose") + self.assertEqual((plain.returncode, verbose.returncode), (0, 0)) + self.assertNotEqual(plain.stdout, verbose.stdout) + + class EmulatorPackReadsThePlatformsDir(unittest.TestCase): def test_the_registry_comes_from_the_given_dir(self): sys.path.insert(0, str(REPO_ROOT / "scripts"))