Kill the last endless-wait mutants

This commit is contained in:
2026-11-18 20:04:45 +01:00
parent 85e69a9760
commit ef552931df
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -45,12 +45,12 @@ def loops(simples: list[Simple]) -> list[list[Simple]]:
open_loops: list[list[Simple]] = []
closed = []
for simple in (Simple(core(simple.words), simple.directory) for simple in simples):
first = simple.words[:1]
kind = simple.words[0] if simple.words else None
for loop in open_loops:
loop.append(simple)
if first and first[0] in LOOPS:
if kind in LOOPS:
open_loops.append([simple])
elif first == ["done"] and open_loops:
elif kind == "done" and open_loops:
closed.append(open_loops.pop())
return closed + open_loops
+1 -1
View File
@@ -166,7 +166,7 @@ class CommandBreaches(unittest.TestCase):
self.assertEqual([breach.directory for breach in found], ["/w"])
self.assertIn(f"`{head[:60]}`, has neither a time limit nor a count cap; use `~/.claude/bin/wait-for", found[0].detail)
self.assertEqual([breach.directory for breach in breaches("cd /w && bash -c 'pgrep -f x; until [ -s f ]; do sleep 1; done'")], ["/w", "/w"])
self.assertEqual([breach.directory for breach in breaches("cd /w && until [ -s f ]; do cd /x && sleep 1; done")], ["/w"])
self.assertEqual([breach.directory for breach in breaches("cd /w && until [ -s f ] && cd /x && true; do sleep 1; done")], ["/w"])
self.assertEqual(len(breaches("pgrep -f aa; bash -c 'pgrep -f bb'")), 2)
def test_a_loop_that_waits_on_its_own_pgrep_breaks_endless_wait_twice(self):