From a7a818fc73c78c1461b8bb2bb349573940678db8 Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Sun, 30 Sep 2007 09:46:41 +0200 Subject: properties for tag renaming darcs-hash:20070930074641-cba2c-f0ba43bf6d62f372dfee8dfdadf4fe66677e0510 --- tests/Properties.hs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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) -- cgit v1.2.3