From bd0f1f7a50ac386c2946b64cf65f9459dd8f86c5 Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Sun, 23 Mar 2008 00:49:52 +0100 Subject: some tests for the size increment handling in Operations.hs darcs-hash:20080322234952-cba2c-5bc18928813ea1674988a6857a15eedde696bf7d --- tests/Properties.hs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/Properties.hs b/tests/Properties.hs index dd3dd8e..3f78b03 100644 --- a/tests/Properties.hs +++ b/tests/Properties.hs @@ -4,6 +4,7 @@ module Properties where import XMonad.StackSet hiding (filter) import XMonad.Layout import XMonad.Core hiding (workspaces,trace) +import XMonad.Operations ( applyResizeIncHint ) import qualified XMonad.StackSet as S (filter) import Debug.Trace @@ -809,6 +810,19 @@ noOverlaps xs = and [ verts a `notOverlap` verts b = (top1 < bottom2 || top2 < bottom1) || (right1 < left2 || right2 < left1) +------------------------------------------------------------------------ +-- Aspect ratios + +prop_resize_inc (NonZero (NonNegative inc_w),NonZero (NonNegative inc_h)) b@(w,h) = + w' `mod` inc_w == 0 && h' `mod` inc_h == 0 + where (w',h') = applyResizeIncHint a b + a = (inc_w,inc_h) + +prop_resize_inc_extra ((NonNegative inc_w)) b@(w,h) = + (w,h) == (w',h') + where (w',h') = applyResizeIncHint a b + a = (-inc_w,0::Dimension)-- inc_h) + ------------------------------------------------------------------------ main :: IO () @@ -954,6 +968,10 @@ main = do ,("describe mirror", mytest prop_desc_mirror) + -- resize hints + ,("window hints: inc", mytest prop_resize_inc) + ,("window hints: inc all", mytest prop_resize_inc_extra) + ] ------------------------------------------------------------------------ -- cgit v1.2.3