summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-05-02 22:16:22 +0200
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-05-02 22:16:22 +0200
commit7f7c8caa4229c737161456cc13c2d4d2b314eb8b (patch)
treed9c03695ba08c768232b5475eda01dc48e4e9777
parent792a2c7a32a57fe13c348f227fab6463d5ef3bb5 (diff)
downloadmetatile-7f7c8caa4229c737161456cc13c2d4d2b314eb8b.tar
metatile-7f7c8caa4229c737161456cc13c2d4d2b314eb8b.zip
Fix tests after StackSet changes
darcs-hash:20070502201622-a5988-ac80f011c59276c52314ea128c07a54487c9bee9
-rw-r--r--tests/Properties.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/Properties.hs b/tests/Properties.hs
index 3b57dff..1240734 100644
--- a/tests/Properties.hs
+++ b/tests/Properties.hs
@@ -66,8 +66,9 @@ instance (Integral i, Integral j, Ord a, Arbitrary a) => Arbitrary (StackSet i j
--
-- All operations must preserve this.
--
-invariant (w :: T) = inBounds w && noDuplicates (concat $ M.elems (stacks w))
+invariant (w :: T) = inBounds w && noDuplicates allWindows
where
+ allWindows = concatMap (uncurry (++)) . M.elems . stacks $ w
noDuplicates ws = nub ws == ws
inBounds x = current x >= 0 && current x < sz where sz = M.size (stacks x)
@@ -76,7 +77,7 @@ prop_invariant = invariant
-- empty StackSets have no windows in them
-prop_empty n m = n > 0 && m > 0 ==> all null (M.elems (stacks x))
+prop_empty n m = n > 0 && m > 0 ==> all (null . uncurry (++)) (M.elems (stacks x))
where x = empty n m :: T
-- empty StackSets always have focus on workspace 0