Kill the mutant that reads any word recurse after an option as recursion

This commit is contained in:
2026-11-13 23:01:57 +01:00
parent 472b15b76d
commit 7fec47f9b9
+4
View File
@@ -494,6 +494,10 @@ class EnvFileRead(unittest.TestCase):
with self.subTest(command):
self.assertEqual(self.breached("Bash", {"command": command}), [])
self.assertEqual(self.breached("Bash", {"command": "rg TOKEN"}, f"{self.home}/code"), [])
# The word recurse is only a pattern or a file name here, and -d read is no recursion.
for command in ("grep -n recurse notes.md", "grep -d read TOKEN ~/secrets", "grep --directories read TOKEN ~/secrets"):
with self.subTest(command):
self.assertEqual(self.breached("Bash", {"command": command}, str(self.home)), [])
# secrets is the pattern, not the folder ~/secrets that the home directory holds.
self.assertEqual(self.breached("Bash", {"command": "rg secrets ~/code"}, str(self.home)), [])