From 1d1172098f0ea5d94f05112d4096d9fc38ab22d3 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 12 Nov 2026 09:20:11 +0100 Subject: [PATCH] Kill the surviving mutants of claudeMdExcludes and wait-for's half-line cut --- bin/larv_review/test_scoring_setup.py | 19 ++++++++++++++++++- bin/wait_for/test_wait_for.py | 14 ++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/bin/larv_review/test_scoring_setup.py b/bin/larv_review/test_scoring_setup.py index 9da569c8..5fbad317 100644 --- a/bin/larv_review/test_scoring_setup.py +++ b/bin/larv_review/test_scoring_setup.py @@ -9,7 +9,7 @@ import unittest sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) -from larv_review.scoring_setup import bullets, file_globs, preloaded_files, prepare_scoring, project_values, score_bullets, section +from larv_review.scoring_setup import bullets, CLAUDE_MD, file_globs, preloaded_files, prepare_scoring, project_values, score_bullets, section from failure import Failure from test_env import isolated_env @@ -154,6 +154,23 @@ class PrepareScoring(unittest.TestCase): (self.checkout / ".claude" / "settings.json").write_text('{"claudeMdExcludes": [3]}\n') self.assertEqual(preloaded_files(self.checkout, self.root), f"`~/.claude/CLAUDE.md` and `~/.claude/rules/{rule}.md`") + def test_reads_the_excludes_of_both_settings_files_and_names_none_where_nothing_loads(self): + (self.root / ".claude").mkdir() + (self.root / ".claude" / "CLAUDE.md").write_text("# Home\n") + (self.checkout / "CLAUDE.md").write_text("# Project\n") + (self.checkout / ".claude").mkdir() + settings, local = self.checkout / ".claude" / "settings.json", self.checkout / ".claude" / "settings.local.json" + for first, second in (("not json", '{"claudeMdExcludes": ["**/.claude/*.md", "**/proj/*.md"]}'), ('{"claudeMdExcludes": ["**/.claude/*.md"]}', '{"claudeMdExcludes": ["**/proj/*.md"]}')): + with self.subTest(first=first): + settings.write_text(first) + local.write_text(second) + self.assertEqual(preloaded_files(self.checkout, self.root), "none") + for odd in ("[1]", '{"claudeMdExcludes": 3}'): + with self.subTest(odd=odd): + settings.write_text(odd) + local.write_text(odd) + self.assertEqual(preloaded_files(self.checkout, self.root), f"`~/.claude/{CLAUDE_MD}` and `{CLAUDE_MD}`") + if __name__ == "__main__": unittest.main() diff --git a/bin/wait_for/test_wait_for.py b/bin/wait_for/test_wait_for.py index 779bebe3..08d880b4 100644 --- a/bin/wait_for/test_wait_for.py +++ b/bin/wait_for/test_wait_for.py @@ -69,6 +69,20 @@ class WaitFor(unittest.TestCase): self.assertEqual(main.waited(str(self.file), None, 60, clock), "No findings.") self.assertEqual(clock.now, main.POLL_SECONDS) + def test_takes_a_whole_line_at_once_beside_a_half_written_one(self): + self.file.write_text("a\nb\npart") + clock = Clock() + self.assertEqual(main.waited(str(self.file), "b", 60, clock), "b") + self.assertEqual(clock.now, 0) + self.file.write_text("done\n") + self.assertEqual(main.waited(str(self.file), None, 60, clock), "done") + self.assertEqual(clock.now, 0) + + def test_matches_no_part_of_a_half_written_first_line(self): + self.file.write_text("part") + clock = Clock(lambda: self.file.write_text("partial\n")) + self.assertEqual(main.waited(str(self.file), "p", 60, clock), "partial") + def test_reads_a_line_that_is_not_utf_8(self): self.file.write_bytes(b"caf\xe9 passed\n") self.assertEqual(main.waited(str(self.file), "passed", 60, Clock()), "caf\ufffd passed")