test(app-iced): M75 —— probe 分隔线判据改为「非底色长横线」+ 修 forced 改成 Option 后的两处测试
线在 fractional y 上被抗锯齿摊到两行,按精确 OutlineVariant 色匹配抓不到(实测 0 行); 改为「非 Surface 的长横线」计数,断言 2..=6 行(两条线 × 各 1~2 行)。
This commit is contained in:
1 parent
5f85891e7e
commit
8072f1cc7e
2 files changed
+12
-13
No files matched your search
@@ -173,14 +173,14 @@ fn gallery_geometry_matches_the_tokens() {
|
||||
}
|
||||
assert!(measured_glyph, "没量到 IconButton 的字形");
|
||||
|
||||
// ---- 22.1:分隔线 1px -----------------------------------------------------
|
||||
let outline = rgb(ui.color(Role::OutlineVariant));
|
||||
// ---- 22.1:分隔线 1px(按「非底色的长横线」判,不按精确色:线被抗锯齿摊到两行)----
|
||||
let surface = rgb(ui.color(Role::Surface));
|
||||
let mut runs = 0;
|
||||
for y in 0..shot.height {
|
||||
let mut longest = 0;
|
||||
let mut current = 0;
|
||||
for x in 0..shot.width {
|
||||
if matches(shot.at(x, y), outline) {
|
||||
if !matches(shot.at(x, y), surface) {
|
||||
current += 1;
|
||||
longest = longest.max(current);
|
||||
} else {
|
||||
@@ -191,11 +191,10 @@ fn gallery_geometry_matches_the_tokens() {
|
||||
runs += 1;
|
||||
}
|
||||
}
|
||||
// 分隔线是 1px 高,所以「长横线」的行数 = 屏上分隔线条数(每条约 1 行)
|
||||
assert!(runs >= 2, "至少该有 2 条分隔线(实际 {runs} 行)");
|
||||
// 两条分隔线 × 各摊在 1~2 行上(抗锯齿)⇒ 2..=6 行;>6 说明线粗了或画了第三条
|
||||
assert!(
|
||||
runs <= 4,
|
||||
"分隔线最多 2 条 × 1px,实测 {runs} 行(22.1:大于这个数说明线不是 1px)"
|
||||
(2..=6).contains(&runs),
|
||||
"分隔线应 2 条 × 1px(抗锯齿时各占 2 行),实测 {runs} 行"
|
||||
);
|
||||
|
||||
// ---- 12b 1.8:禁用格必须与静息格不同 ------------------------------------
|
||||
|
||||
Reference in new issue
Block a user