diff options
Diffstat (limited to 'crates/wayland/src/state/tests.rs')
| -rw-r--r-- | crates/wayland/src/state/tests.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/crates/wayland/src/state/tests.rs b/crates/wayland/src/state/tests.rs index bccbae2..8d1d8b3 100644 --- a/crates/wayland/src/state/tests.rs +++ b/crates/wayland/src/state/tests.rs @@ -2,12 +2,15 @@ #[test] fn focused_window_keeps_its_configured_colour() { - assert_eq!(effective_border_color((136, 192, 208), true), (136, 192, 208)); + // The dim factor is irrelevant when focused - passing an + // obviously-wrong one here doubles as proof the early return never + // even looks at it. + assert_eq!(effective_border_color((136, 192, 208), true, 0.0), (136, 192, 208)); } #[test] fn unfocused_window_is_dimmed_but_still_recognisably_that_colour() { - let dimmed = effective_border_color((136, 192, 208), false); + let dimmed = effective_border_color((136, 192, 208), false, 0.35); // Dimmer in every channel... assert!(dimmed.0 < 136 && dimmed.1 < 192 && dimmed.2 < 208); // ...but not black, and the channels' relative order is preserved @@ -19,6 +22,15 @@ } #[test] + fn inactive_dim_factor_is_actually_configurable() { + // `theme.decorations.border.inactive_dim` - `1.0` keeps an + // unfocused border identical to focused, `0.0` removes it entirely + // (fully black, matching every channel scaled to zero). + assert_eq!(effective_border_color((136, 192, 208), false, 1.0), (136, 192, 208)); + assert_eq!(effective_border_color((136, 192, 208), false, 0.0), (0, 0, 0)); + } + + #[test] fn window_anim_starts_at_from_and_ends_at_to() { let anim = WindowAnim { from: srdwm_core::Rect::new(0, 100, 300, 200), |