summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorglasser <glasser@mit.edu>2007-05-25 18:31:59 +0200
committerglasser <glasser@mit.edu>2007-05-25 18:31:59 +0200
commit552d8086d5dd9ff14ee1cbf83da771c63a4c0784 (patch)
treee2c0986ad20f558e76bcdd427d9974abdffb5451
parent27c3bbe9657f1d003428de55dfa16c5314801b77 (diff)
downloadmetatile-552d8086d5dd9ff14ee1cbf83da771c63a4c0784.tar
metatile-552d8086d5dd9ff14ee1cbf83da771c63a4c0784.zip
Add a test that the size field of StackSet is correct to QuickCheck invariant.
darcs-hash:20070525163159-64353-15e04204eb27aebe6c98a58c8e26b5c5d3083348
-rw-r--r--tests/Properties.hs3
1 files changed, 3 insertions, 0 deletions
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