Resolve every cited CLAUDE.md heading in a test #27

Merged
lilleman merged 6 commits from citations into main 2026-09-25 00:37:28 +02:00
Showing only changes of commit 1c05fbc5da - Show all commits
+2 -1
View File
@@ -21,4 +21,5 @@ class Citations(unittest.TestCase):
self.assertEqual([f"{path}: {stray}" for path, text in texts for stray in STRAY.findall(text)], [], 'spell a citation `CLAUDE.md` → "Vocabulary"')
cited = [(path, NAME.findall(run)) for path, text in texts for run in CITATION.findall(text)]
self.assertTrue(cited)
self.assertEqual([f"{path}: {names}" for path, names in cited if names[0] not in headings or set(names[1:]) - leads], [])
unresolved = [(path, name) for path, names in cited for name in [n for n in names[:1] if n not in headings] + [n for n in names[1:] if n not in leads]]
self.assertEqual([f"{path}: {name}" for path, name in unresolved], [], "the first name is a heading of CLAUDE.md, each later one a heading or a bold lead")