mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-11 18:21:51 -07:00
add property for ensureTags behaviour on hidden workspaces
This commit is contained in:
@@ -622,9 +622,26 @@ prop_rename1 (x::T) o n = o `tagMember` x && not (n `tagMember` x) ==>
|
|||||||
let y = renameTag o n x
|
let y = renameTag o n x
|
||||||
in n `tagMember` y
|
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
|
prop_ensure (x :: T) l xs = let y = ensureTags l xs x
|
||||||
in and [ n `tagMember` y | n <- xs ]
|
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_mapWorkspaceId (x::T) = x == mapWorkspace id x
|
||||||
|
|
||||||
prop_mapWorkspaceInverse (x::T) = x == mapWorkspace predTag (mapWorkspace succTag x)
|
prop_mapWorkspaceInverse (x::T) = x == mapWorkspace predTag (mapWorkspace succTag x)
|
||||||
@@ -777,6 +794,7 @@ main = do
|
|||||||
,("screens works", mytest prop_screens_works)
|
,("screens works", mytest prop_screens_works)
|
||||||
,("renaming works", mytest prop_rename1)
|
,("renaming works", mytest prop_rename1)
|
||||||
,("ensure works", mytest prop_ensure)
|
,("ensure works", mytest prop_ensure)
|
||||||
|
,("ensure hidden semantics", mytest prop_ensure_append)
|
||||||
|
|
||||||
,("mapWorkspace id", mytest prop_mapWorkspaceId)
|
,("mapWorkspace id", mytest prop_mapWorkspaceId)
|
||||||
,("mapWorkspace inverse", mytest prop_mapWorkspaceInverse)
|
,("mapWorkspace inverse", mytest prop_mapWorkspaceInverse)
|
||||||
|
Reference in New Issue
Block a user