优化: 清理无意义注释(走查编号前缀/过时历史标注/死代码注释)
This commit is contained in:
@@ -1135,7 +1135,7 @@ mod tests {
|
||||
#[test]
|
||||
fn extract_key_info_single_huge_line_no_newline_compressed() {
|
||||
// 单行超大内容(50KB)原本逃逸压缩,现按字符数截断保留头尾。
|
||||
// 注:read_file 已豁免压缩(BUG-260801),此处用 run_command 验证通用压缩路径。
|
||||
// 注:read_file 已豁免压缩,此处用 run_command 验证通用压缩路径。
|
||||
let content = "x".repeat(50_000);
|
||||
let result = extract_key_info(&content, "run_command");
|
||||
assert!(result.len() < content.len(), "单行超长应压缩: {} >= {}", result.len(), content.len());
|
||||
@@ -1149,7 +1149,7 @@ mod tests {
|
||||
fn extract_key_info_json_huge_string_field_truncated() {
|
||||
// JSON 对象中大字符串字段(单行少行)逃逸压缩。
|
||||
// 如 `{"path":"src/main.rs","content":"单行超大文本..."}`。
|
||||
// 注:read_file 已豁免压缩(BUG-260801),此处用 run_command 验证通用压缩路径。
|
||||
// 注:read_file 已豁免压缩,此处用 run_command 验证通用压缩路径。
|
||||
let large = "z".repeat(10_000);
|
||||
let content = format!("{{\"path\":\"src/main.rs\",\"content\":\"{}\"}}", large);
|
||||
let result = extract_key_info(&content, "run_command");
|
||||
@@ -1171,7 +1171,7 @@ mod tests {
|
||||
#[test]
|
||||
fn extract_key_info_eleven_lines_triggers_compression() {
|
||||
// 边界:行数 == 11(刚超 kept_boundary=10)→ 触发压缩,含标记
|
||||
// 注:read_file 已豁免压缩(BUG-260801),此处用 run_command 验证通用压缩路径。
|
||||
// 注:read_file 已豁免压缩,此处用 run_command 验证通用压缩路径。
|
||||
let lines: Vec<String> = (1..=11).map(|i| format!("line {}", i)).collect();
|
||||
let content = lines.join("\n");
|
||||
let result = extract_key_info(&content, "run_command");
|
||||
@@ -1185,7 +1185,7 @@ mod tests {
|
||||
// 边界:错误行恰在头部区间内(idx < head_end)→ 不重复插入(头部已含)
|
||||
// 错误行在尾部区间内(idx >= tail_start)→ 不重复插入(尾部已含)
|
||||
// 错误行在中间区间 → 标注 [行 N] 插入
|
||||
// 注:read_file 已豁免压缩(BUG-260801),此处用 run_command 验证通用压缩路径。
|
||||
// 注:read_file 已豁免压缩,此处用 run_command 验证通用压缩路径。
|
||||
let mut lines: Vec<String> = (1..=20).map(|i| format!("norm {}", i)).collect();
|
||||
// idx=2(头部区间 [0,5))错误行 → 头部已含,不在 error_lines(扫描跳过 head/tail)
|
||||
lines[2] = "error in head zone".to_string();
|
||||
@@ -1347,7 +1347,7 @@ mod tests {
|
||||
assert_eq!(extract_pending_tc_id(""), None);
|
||||
}
|
||||
|
||||
// ── read_file 豁免压缩(BUG-260801: AI 定向读代码不应被折叠) ──
|
||||
// ── read_file 豁免压缩AI 定向读代码不应被折叠) ──
|
||||
//
|
||||
// 根因:extract_key_info 的 JSON 分支对 content 字段(文件内容)行数 > 10 即折叠中间为
|
||||
// "(压缩中间内容)"。read_file limit=100 读 28KB(100 行)→ 触发 → AI 只拿到首尾各 5 行,
|
||||
|
||||
Reference in New Issue
Block a user