test(app-iced): M75 —— probe 分隔线判据改为「非底色长横线」+ 修 forced 改成 Option 后的两处测试

线在 fractional y 上被抗锯齿摊到两行,按精确 OutlineVariant 色匹配抓不到(实测 0 行);
改为「非 Surface 的长横线」计数,断言 2..=6 行(两条线 × 各 1~2 行)。
This commit is contained in:
AskaEth committed 2026-11-02 04:50:49 +08:00
1 parent 5f85891e7e
commit 8072f1cc7e
2 files changed
+12 -13

No files matched your search

@@ -212,7 +212,7 @@ fn icon_button_variants_match_the_reference_roles() {
}
}
fn spec_of(variant: Variant, forced: Interaction) -> StyleSpec {
fn spec_of(variant: Variant, forced: Option<Interaction>) -> StyleSpec {
let (fill, content, border) = variant.roles();
StyleSpec {
fill,
@@ -220,7 +220,7 @@ fn spec_of(variant: Variant, forced: Interaction) -> StyleSpec {
border,
shape: variant.shape(),
radius_side: Geometry::of(&light(), variant, false).height,
forced: Some(forced),
forced,
}
}
@@ -228,7 +228,7 @@ fn spec_of(variant: Variant, forced: Interaction) -> StyleSpec {
#[test]
fn outlined_style_draws_hairline_border_and_full_radius() {
let ui = light();
let style = style_closure(&ui, spec_of(Variant::Outlined, Interaction::Enabled));
let style = style_closure(&ui, spec_of(Variant::Outlined, None));
let idle = style(&ui.theme(), button::Status::Active);
assert_eq!(idle.background, None, "Outlined 静息容器必须透明");
@@ -255,7 +255,7 @@ fn outlined_style_draws_hairline_border_and_full_radius() {
#[test]
fn filled_button_state_layers_are_visible_and_ordered() {
let ui = light();
let style = style_closure(&ui, spec_of(Variant::Filled, Interaction::Enabled));
let style = style_closure(&ui, spec_of(Variant::Filled, None));
let idle = style(&ui.theme(), button::Status::Active);
let hovered = style(&ui.theme(), button::Status::Hovered);
@@ -283,7 +283,7 @@ fn filled_button_state_layers_are_visible_and_ordered() {
#[test]
fn forced_state_overrides_the_runtime_status() {
let ui = light();
let style = style_closure(&ui, spec_of(Variant::Tonal, Interaction::Hovered));
let style = style_closure(&ui, spec_of(Variant::Tonal, Some(Interaction::Hovered)));
// 运行期说 Active,但取证要 hover → 必须画 hover
assert_eq!(
style(&ui.theme(), button::Status::Active).background,
@@ -300,7 +300,7 @@ fn forced_state_overrides_the_runtime_status() {
#[test]
fn elevated_uses_a_tone_not_a_shadow() {
let ui = light();
let style = style_closure(&ui, spec_of(Variant::Elevated, Interaction::Enabled));
let style = style_closure(&ui, spec_of(Variant::Elevated, None));
let idle = style(&ui.theme(), button::Status::Active);
assert_eq!(idle.shadow, Shadow::default(), "rubric §7:L1 不画阴影");
assert_eq!(