Make the citation message a resolving example
This commit is contained in:
@@ -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], [])
|
||||
|
||||
Reference in New Issue
Block a user