From 7f7c8caa4229c737161456cc13c2d4d2b314eb8b Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Wed, 2 May 2007 22:16:22 +0200 Subject: Fix tests after StackSet changes darcs-hash:20070502201622-a5988-ac80f011c59276c52314ea128c07a54487c9bee9 --- tests/Properties.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests') 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 -- cgit v1.2.3