fix: [test] _extract_content_units 表格行计数包含非功能章节 - Closes #33 #35

Merged
pzhang_zywl merged 2 commits from test/issue-33 into main 2026-06-01 14:07:19 +08:00
Showing only changes of commit 119c08faca - Show all commits
+7 -1
View File
@@ -137,12 +137,18 @@ def _extract_content_units(parsed_data: dict) -> dict:
for sec in sections:
name = sec.get("source", "")
if _is_functional_section(name) and _has_section_content(sec):
is_func = _is_functional_section(name) and _has_section_content(sec)
if is_func:
functional_sections.append({
"name": name,
"number": _section_number(name),
})
# Only count table rows from functional sections
# (non-functional sections like changelog, glossary, references
# cannot be covered by function_units — counting them inflates
# the denominator and yields misleadingly low coverage.)
if is_func:
for block in sec.get("blocks", []):
if block.get("type") == "table":
rows = block.get("rows", [])