aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDon Stewart <dons@galois.com>2007-09-30 09:46:41 +0200
committerDon Stewart <dons@galois.com>2007-09-30 09:46:41 +0200
commitf24927184e93bb7edd28682612d1b7a51f285439 (patch)
tree92dfe1041f715559feaf7b303f0209f02a5301c3 /tests
parentbe2cae5a46c6d88acc7aa98435c2a64ec275254f (diff)
downloadxmonad-f24927184e93bb7edd28682612d1b7a51f285439.tar.gz
xmonad-f24927184e93bb7edd28682612d1b7a51f285439.tar.xz
xmonad-f24927184e93bb7edd28682612d1b7a51f285439.zip
properties for tag renaming
darcs-hash:20070930074641-cba2c-f0ba43bf6d62f372dfee8dfdadf4fe66677e0510.gz
Diffstat (limited to 'tests')
-rw-r--r--tests/Properties.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/Properties.hs b/tests/Properties.hs
index 4c7c2be..447dae8 100644
--- a/tests/Properties.hs
+++ b/tests/Properties.hs
@@ -583,6 +583,22 @@ prop_new_abort x = unsafePerformIO $ C.catch f
-- prop_view_should_fail = view {- with some bogus data -}
+-- screens makes sense
+prop_screens_works (x :: T) = screens x == current x : visible x
+
+------------------------------------------------------------------------
+-- renaming tags
+
+-- | Rename a given tag if present in the StackSet.
+-- 408 renameTag :: Eq i => i -> i -> StackSet i l a s sd -> StackSet i l a s sd
+
+prop_rename1 (x::T) o n = o `tagMember` x && not (n `tagMember` x) ==>
+ let y = renameTag o n x
+ in n `tagMember` y
+
+prop_ensure (x :: T) l xs = let y = ensureTags l xs x
+ in and [ n `tagMember` y | n <- xs ]
+
------------------------------------------------------------------------
-- some properties for layouts:
@@ -716,12 +732,17 @@ main = do
,("differentiate works", mytest prop_differentiate)
,("lookupTagOnScreen", mytest prop_lookup_current)
,("lookupTagOnVisbleScreen", mytest prop_lookup_visible)
+ ,("screens works", mytest prop_screens_works)
+ ,("renaming works", mytest prop_rename1)
+ ,("ensure works", mytest prop_ensure)
-- testing for failure:
,("abort fails", mytest prop_abort)
,("new fails with abort", mytest prop_new_abort)
,("shiftWin identity", mytest prop_shift_win_indentity)
+ -- renaming
+
{-
,("tile 1 window fullsize", mytest prop_tile_fullscreen)
,("tiles never overlap", mytest prop_tile_non_overlap)