From e3c16e0900d65e70d68f6a11f67ade5f74ad66d5 Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Mon, 30 Apr 2007 07:10:16 +0200 Subject: add two properties relating to empty window managers darcs-hash:20070430051016-9c5c1-ec4c5d4ed5353026b45a769570d53cf299b31ec2 --- tests/Properties.hs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'tests') 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) -- cgit v1.2.3