aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
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)