diff options
author | Don Stewart <dons@galois.com> | 2007-09-30 09:46:41 +0200 |
---|---|---|
committer | Don Stewart <dons@galois.com> | 2007-09-30 09:46:41 +0200 |
commit | a7a818fc73c78c1461b8bb2bb349573940678db8 (patch) | |
tree | 92dfe1041f715559feaf7b303f0209f02a5301c3 | |
parent | 80f6b60b4164c6217d1d4ac8ae1f38b88fdf05e6 (diff) | |
download | metatile-a7a818fc73c78c1461b8bb2bb349573940678db8.tar metatile-a7a818fc73c78c1461b8bb2bb349573940678db8.zip |
properties for tag renaming
darcs-hash:20070930074641-cba2c-f0ba43bf6d62f372dfee8dfdadf4fe66677e0510
-rw-r--r-- | tests/Properties.hs | 21 |
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) |