summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Stewart <dons@galois.com>2008-03-23 00:49:52 +0100
committerDon Stewart <dons@galois.com>2008-03-23 00:49:52 +0100
commitbd0f1f7a50ac386c2946b64cf65f9459dd8f86c5 (patch)
tree0293cb644e7c622faef4f7adeef3c24632d93c8b
parentc3cad624fdd38acf33b4e850d470a9752935f3d5 (diff)
downloadmetatile-bd0f1f7a50ac386c2946b64cf65f9459dd8f86c5.tar
metatile-bd0f1f7a50ac386c2946b64cf65f9459dd8f86c5.zip
some tests for the size increment handling in Operations.hs
darcs-hash:20080322234952-cba2c-5bc18928813ea1674988a6857a15eedde696bf7d
-rw-r--r--tests/Properties.hs18
1 files changed, 18 insertions, 0 deletions
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
@@ -810,6 +811,19 @@ noOverlaps xs = and [ verts a `notOverlap` verts b
|| (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 ()
main = do
@@ -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)
+
]
------------------------------------------------------------------------