aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Properties.hs
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
commit17de8e5fba5e4d563a11818570650b74e76f33f4 (patch)
treee2c0986ad20f558e76bcdd427d9974abdffb5451 /tests/Properties.hs
parenta31306105278d1a8435e15184af8313698713ae0 (diff)
downloadxmonad-17de8e5fba5e4d563a11818570650b74e76f33f4.tar.gz
xmonad-17de8e5fba5e4d563a11818570650b74e76f33f4.tar.xz
xmonad-17de8e5fba5e4d563a11818570650b74e76f33f4.zip
Add a test that the size field of StackSet is correct to QuickCheck invariant.
darcs-hash:20070525163159-64353-15e04204eb27aebe6c98a58c8e26b5c5d3083348.gz
Diffstat (limited to 'tests/Properties.hs')
-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