aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDon Stewart <dons@galois.com>2008-03-10 19:25:57 +0100
committerDon Stewart <dons@galois.com>2008-03-10 19:25:57 +0100
commite0850802f7e84f827badf5671ec4342ad364a012 (patch)
tree24a299c40c6b83b6e561b07cae825f7678afa151 /tests
parent4678e2944a426b082b27d28c2a72ad6b8faced94 (diff)
downloadxmonad-e0850802f7e84f827badf5671ec4342ad364a012.tar.gz
xmonad-e0850802f7e84f827badf5671ec4342ad364a012.tar.xz
xmonad-e0850802f7e84f827badf5671ec4342ad364a012.zip
add property for ensureTags behaviour on hidden workspaces
darcs-hash:20080310182557-cba2c-9e539e452dbcb111fc47098dd762811c8334d4d8.gz
Diffstat (limited to 'tests')
-rw-r--r--tests/Properties.hs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/Properties.hs b/tests/Properties.hs
index f8f0684..6135792 100644
--- a/tests/Properties.hs
+++ b/tests/Properties.hs
@@ -622,9 +622,26 @@ prop_rename1 (x::T) o n = o `tagMember` x && not (n `tagMember` x) ==>
let y = renameTag o n x
in n `tagMember` y
+-- |
+-- Ensure that a given set of workspace tags is present by renaming
+-- existing workspaces and\/or creating new hidden workspaces as
+-- necessary.
+--
prop_ensure (x :: T) l xs = let y = ensureTags l xs x
in and [ n `tagMember` y | n <- xs ]
+-- adding a tag should create a new hidden workspace
+prop_ensure_append (x :: T) l n =
+ not (n `tagMember` x)
+ ==>
+ (hidden y /= hidden x -- doesn't append, renames
+ &&
+ and [ isNothing (stack z) && layout z == l | z <- hidden y, tag z == n ]
+ )
+ where
+ y = ensureTags l (n:ts) x
+ ts = [ tag z | z <- workspaces x ]
+
prop_mapWorkspaceId (x::T) = x == mapWorkspace id x
prop_mapWorkspaceInverse (x::T) = x == mapWorkspace predTag (mapWorkspace succTag x)
@@ -777,6 +794,7 @@ main = do
,("screens works", mytest prop_screens_works)
,("renaming works", mytest prop_rename1)
,("ensure works", mytest prop_ensure)
+ ,("ensure hidden semantics", mytest prop_ensure_append)
,("mapWorkspace id", mytest prop_mapWorkspaceId)
,("mapWorkspace inverse", mytest prop_mapWorkspaceInverse)