fix: correct convergence logic in hcatFingerprint loop

The old loop reassigned crackedBefore at the top of each iteration and
initialized crackedAfter to 0, which could cause the loop to enter
spuriously or skip entirely. Switch to while True / break to properly
detect when an iteration produces no new cracks.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Justin Bollinger
2026-04-13 10:10:01 -04:00
co-authored by Claude Opus 4.6
parent 2b169ae362
commit 1b5f6bee2e
2 changed files with 6 additions and 4 deletions
@@ -42,7 +42,8 @@ def test_hcatFingerprint_uses_selected_expander_and_calls_hybrid(monkeypatch, tm
out_path.write_text("deadbeef:Accordbookkeeping2025!:x\n")
# Make the loop run exactly one iteration.
counts = iter([1, 1, 1, 1])
# Calls: before-loop(1), end-of-iteration(1) == before → break, post-loop(1).
counts = iter([1, 1, 1])
monkeypatch.setattr(hc_main, "lineCount", lambda _p: next(counts))
monkeypatch.setattr(hc_main, "hcatHashCracked", 0)