summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Stewart <dons@cse.unsw.edu.au>2007-04-30 07:10:16 +0200
committerDon Stewart <dons@cse.unsw.edu.au>2007-04-30 07:10:16 +0200
commite3c16e0900d65e70d68f6a11f67ade5f74ad66d5 (patch)
tree2686d4e0ba95b4e240d824ccb73724a0230ec948
parent2d38e7b6281e2c8b808b7ce90cdb36665b9853ba (diff)
downloadmetatile-e3c16e0900d65e70d68f6a11f67ade5f74ad66d5.tar
metatile-e3c16e0900d65e70d68f6a11f67ade5f74ad66d5.zip
add two properties relating to empty window managers
darcs-hash:20070430051016-9c5c1-ec4c5d4ed5353026b45a769570d53cf299b31ec2
-rw-r--r--tests/Properties.hs14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/Properties.hs b/tests/Properties.hs
index 7d0fb88..55568c8 100644
--- a/tests/Properties.hs
+++ b/tests/Properties.hs
@@ -59,6 +59,15 @@ instance (Integral i, Integral j, Ord a, Arbitrary a) => Arbitrary (StackSet i j
return $ fromList (fromIntegral n,sc,ls)
coarbitrary = error "no coarbitrary for StackSet"
+-- empty StackSets have no windows in them
+prop_empty n m = n > 0 && m > 0 ==> all null (M.elems (stacks x))
+ where x = empty n m :: T
+
+-- empty StackSets always have focus on workspace 0
+prop_empty_current n m = n > 0 && m > 0 ==> current x == 0
+ where x = empty n m :: T
+
+
prop_member1 i n m = n > 0 && m > 0 ==> member i (push i x)
where x = empty n m :: T
@@ -271,7 +280,10 @@ main = do
n = 100
tests =
- [("member/push ", mytest prop_member1)
+ [("empty is empty" , mytest prop_empty)
+ ,("empty / current" , mytest prop_empty_current)
+
+ ,("member/push ", mytest prop_member1)
,("member/peek ", mytest prop_peekmember)
,("member/delete ", mytest prop_member2)
,("member/empty ", mytest prop_member3)