From 552d8086d5dd9ff14ee1cbf83da771c63a4c0784 Mon Sep 17 00:00:00 2001 From: glasser Date: Fri, 25 May 2007 18:31:59 +0200 Subject: Add a test that the size field of StackSet is correct to QuickCheck invariant. darcs-hash:20070525163159-64353-15e04204eb27aebe6c98a58c8e26b5c5d3083348 --- tests/Properties.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') diff --git a/tests/Properties.hs b/tests/Properties.hs index 34b6388..3013985 100644 --- a/tests/Properties.hs +++ b/tests/Properties.hs @@ -103,6 +103,7 @@ hidden_spaces x = map workspace (visible x) ++ hidden x invariant (s :: T) = and -- no duplicates [ noDuplicates + , accurateSize -- all this xinerama stuff says we don't have the right structure -- , validScreens @@ -115,6 +116,8 @@ invariant (s :: T) = and | w <- workspace (current s) : map workspace (visible s) ++ hidden s , let t = stack w, t /= Empty ] :: [Char] noDuplicates = nub ws == ws + calculatedSize = length (visible s) + length (hidden s) + 1 -- +1 is for current + accurateSize = calculatedSize == size s -- validScreens = monotonic . sort . M. . (W.current s : W.visible : W$ s -- cgit v1.2.3