Make the citation message a resolving example

This commit is contained in:
2026-09-25 00:33:43 +02:00
parent 2a12d662ce
commit e0eb78bfd6
+1 -1
View File
@@ -18,7 +18,7 @@ class Citations(unittest.TestCase):
leads = headings | set(LEAD.findall(text))
tracked = subprocess.run(["git", "ls-files", "-z"], capture_output=True, check=True, cwd=ROOT, text=True).stdout.split("\0")
texts = [(path, (ROOT / path).read_text()) for path in filter(None, tracked)]
self.assertEqual([f"{path}: {stray}" for path, text in texts for stray in STRAY.findall(text)], [], 'a citation is `CLAUDE.md` then → "Heading"')
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], [])