test(app-iced): M104 数值表补两行(900 Detached = 404、1180@360 = 812)
报告里贴的那张表要和测试里的表逐行对上:新增的两行证明「拆出后中栗拿回整窗宽,实例详情列 404」 与「360 档把实例页挤成单列(812 < 816 的两列门槛)」这两条结论都是断言的,不是手算的。
This commit is contained in:
1 parent
6eb2846313
commit
8db1c5ab16
1 file changed
+12
-1
@@ -20,6 +20,8 @@ use super::{
|
||||
#[test]
|
||||
fn the_column_table_matches_the_mission_widths() {
|
||||
// (窗口, 档位, 右栗面板, 拖拽缝, 中栗, 实例详情列, 单列页列宽)
|
||||
//
|
||||
// 第三列是**面板宽度**,前两列的「展开档」用默认锚 320;360 那一行显式给值(见 `set_expanded`)。
|
||||
let expect = [
|
||||
(1180.0, RailState::Detached, 0.0, 0.0, 1180.0, 424.0, 424.0),
|
||||
(
|
||||
@@ -32,11 +34,14 @@ fn the_column_table_matches_the_mission_widths() {
|
||||
424.0,
|
||||
),
|
||||
(1180.0, RailState::Expanded, 320.0, 8.0, 852.0, 356.0, 424.0),
|
||||
// 360 档:中栗 812 掉到 medium 档 ⇒ 实例页退化单列(不再有两列硬挤)
|
||||
(1180.0, RailState::Expanded, 360.0, 8.0, 812.0, 424.0, 424.0),
|
||||
(1024.0, RailState::Detached, 0.0, 0.0, 1024.0, 424.0, 424.0),
|
||||
(1024.0, RailState::Collapsed, 48.0, 0.0, 976.0, 424.0, 424.0),
|
||||
// 1024 展开:中栗 696 掉到 medium 档 ⇒ 实例页退化成单列(不再两列硬挤)
|
||||
(1024.0, RailState::Expanded, 320.0, 8.0, 696.0, 424.0, 424.0),
|
||||
// 900 收起:中栗 852 仍够 list-detail(几何门槛 816),详情列 356
|
||||
(900.0, RailState::Detached, 0.0, 0.0, 900.0, 404.0, 424.0),
|
||||
(900.0, RailState::Collapsed, 48.0, 0.0, 852.0, 356.0, 424.0),
|
||||
(900.0, RailState::Expanded, 320.0, 8.0, 572.0, 424.0, 424.0),
|
||||
// 700 < 进程最小窗宽 880:展开档不成立(中栗会被压到 472 以下),退回收起档
|
||||
@@ -44,7 +49,13 @@ fn the_column_table_matches_the_mission_widths() {
|
||||
];
|
||||
|
||||
for (window, rail, width, gutter, content, detail, single) in expect {
|
||||
let laid_out = layout_for(window, rail, DEFAULT_EXPANDED_WIDTH);
|
||||
// 展开档用「锚 320」或表里显式给的更宽档(360)——收起/拆出的行也给 320,不影响结果
|
||||
let expanded = if width > DEFAULT_EXPANDED_WIDTH {
|
||||
width
|
||||
} else {
|
||||
DEFAULT_EXPANDED_WIDTH
|
||||
};
|
||||
let laid_out = layout_for(window, rail, expanded);
|
||||
assert_eq!(
|
||||
(laid_out.rail, laid_out.gutter, laid_out.content),
|
||||
(width, gutter, content),
|
||||
|
||||
Reference in new issue
Block a user