test(app-iced): M102 r5 行距护栏追绑定(M4 假绿做死)+ 等价重构不再假红(M3/M6)
r4 复审的结论是「产品代码没问题,两条 p1 都在护栏的『抓得住』与实测不符」:
- **M4(真正的假绿,做死)**:`rows = rows.spacing(ui.space(Space::X1));` 只要另起一条语句
就能绕过「只锁构建链」的旧护栏。现在 `list_column_spaces_rows_only_from_the_shared_constant`
用 `function_region` 取整段函数,再用 `source::call_arguments` 拿每一处 `rows.spacing(…)`
的实参,并用新增的 `source::derived_from` 顺 `let` / `Some(x) =` 绑定往回追(最多三跳):
实参必须追回 `ROW_SPACING`。于是
· 直接 `ui.space(spacing)`(来自 `if let Some(spacing) = ROW_SPACING`)→ 绿;
· `let spacing = ROW_SPACING;` 再中转(H3)→ 绿;
· 先把令牌挪进 `let extra = Space::X1;` 再 `rows.spacing(ui.space(extra))`(M4)→ 红。
- **M3(假红)**:日志接线护栏改用 `function_region`,于是 `wrap::breakable` 外面套一层同义
包装(`fn soft(…) { mono_owned(ui, wrap::breakable(…)) }`)不再假红;整条链路都没碰
`wrap::breakable` 照样红。
- **M6(假红)**:新增 `source::region_across`(多文件转调跟踪,`frame.rs` + `layout/block.rs`),
把盒子原样搬进 `block::body_box` 再转调不再假红;`align_x` 改判**实参**(`Alignment::Start`
与 `iced::Alignment::Start` 同等放行),于是搬进别的模块后路径写全也不假红。
- **M1/M2 按塔的裁定不加断言**:与 `frame::body` 逐像素等价的另写就是等价重构;docstring 写明
「抓得住:语义变化;抓不住:逐像素等价的另写」。
最终变异矩阵(本轮自跑、每条跑完 `git checkout --` 回滚、白名单已核):
基线 429 passed / 0 failed;M4 红(只红 list_column_spaces_rows_only_from_the_shared_constant);
M3 绿;M6 绿;G 红(只红 single_column_pages_call_the_body_box_not_the_centred_one);
I 红(只红 the_page_wires_the_soft_breaks_into_both_rendering_paths);
旧 p1 复跑 A 红、D 红,等价重构 J 绿。
This commit is contained in:
1 parent
f499961e5b
commit
4b26a0a9dc
5 files changed
+299
-39
No files matched your search
@@ -92,15 +92,19 @@ fn log_text_carries_soft_breaks_but_keeps_the_original() {
|
||||
///
|
||||
/// **抓得住**:任一处接线被摘掉(日志行 / 一行摘要);
|
||||
/// **抓不住**:接线写得对但断点表被掏空(那是上一条的事)。
|
||||
///
|
||||
/// 用 [`source::function_region`] 而不是 `function_body`(r4 复审的变异 M3):把
|
||||
/// `wrap::breakable` 外面套一层同义包装(`fn soft(…) { wrap::breakable(…) }`)再调用,是
|
||||
/// **等价重构**,不该假红;而「整条链路都没碰 `wrap::breakable`」照样红。
|
||||
#[test]
|
||||
fn the_page_wires_the_soft_breaks_into_both_rendering_paths() {
|
||||
let entry = source::function_body(include_str!("lines.rs"), "fn entry");
|
||||
let entry = source::function_region(include_str!("lines.rs"), "fn entry");
|
||||
assert!(
|
||||
entry.contains("wrap::breakable("),
|
||||
"日志行没接软断点(`graphics.gl_operation_failure` 会被按字形劈开):\n{entry}"
|
||||
);
|
||||
|
||||
let summary = source::function_body(include_str!("diagnostic.rs"), "fn summary_block");
|
||||
let summary = source::function_region(include_str!("diagnostic.rs"), "fn summary_block");
|
||||
assert!(
|
||||
summary.contains("wrap::breakable("),
|
||||
"一行摘要没接软断点:\n{summary}"
|
||||
|
||||
Reference in new issue
Block a user