fix: 覆盖率统计全面修复 + 5漏洞修正

## 修复内容

### C1: _mark_eval 反向操作符 (coverage.py)
- EVALUATE 约束匹配支持  操作符
- WHEN OTHER 的自动检测(全部 WHEN 被否定时)

### C2: _mark_perform 反向操作符 (coverage.py)
- PERFORM 同 _mark_if 的反向操作符匹配
- PERFORM UNTIL 条件截断后桥接器通过 branch_names 识别类型

### H1: parse_single_condition 传递 fields (coverage.py)
- collect_decision_points 调用时传 fields 参数
- NOT 前缀条件解析 (NOT WS-X > 50 → WS-X <= 50)

### H4: generate_data 输入约束 (__init__.py)
- 文档注明接收原始源码,非预处理后文本

### M1: not_map break (cond.py)
- NOT 操作符映射循环添加 break

## 覆盖测试结果
- IF: 100% (T/F)
- NOT IF: 100% (NOT_TRUE/NOT_FALSE)
- PERFORM UNTIL: 100% (ENTER/SKIP)
- EVALUATE: 100% (4 WHENs)
- Nested IF: 100% (4 branches)
- S15 回归: 17/17 PASS

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
NB-076
2026-06-24 21:14:50 +08:00
parent 7fb9304212
commit e2a8d53e60
6 changed files with 104 additions and 15 deletions
+2 -2
View File
@@ -156,7 +156,7 @@ def _make_path_for_branch(dp, branch_idx, fields):
n_when = len(node.when_list)
if branch_idx < n_when:
value, seq = node.when_list[branch_idx]
if is_field(node.subject, []):
if is_field(node.subject, fields):
constraints.append((node.subject, '=', value, True))
prior_cases = [v for v, _ in node.when_list[:branch_idx]]
for prior in prior_cases:
@@ -212,7 +212,7 @@ def enum_paths(node, fields):
if node.has_other:
other_cons = list(dp.get("access_constraints", []))
for v, _ in node.when_list:
if is_field(node.subject, []):
if is_field(node.subject, fields):
other_cons.append((node.subject, '<>', v, True))
paths.append((other_cons, {}))