MCPcopy Create free account
hub / github.com/Qinbf/groundmap / test_anchor_format

Method test_anchor_format

scripts/tests/test_postprocess.py:58–65  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

56 assert "^p-1-" in text
57
58 def test_anchor_format(self):
59 text, blocks = add_anchors("# Title\n\nBody.\n")
60 # heading 锚点格式 h-{level}-{seq}-{hash6}
61 import re
62 h_anchors = re.findall(r"\^(h-\d+-\d+-[a-z0-9]{6})", text)
63 assert len(h_anchors) == 1
64 p_anchors = re.findall(r"\^(p-\d+-[a-z0-9]{6})", text)
65 assert len(p_anchors) == 1
66
67 def test_idempotence_content_unchanged(self):
68 """跑两次必须输出相同文本(最关键的不变量)。"""

Callers

nothing calls this directly

Calls 1

add_anchorsFunction · 0.90

Tested by

no test coverage detected