summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDon Stewart <dons@cse.unsw.edu.au>2007-04-19 03:27:05 +0200
committerDon Stewart <dons@cse.unsw.edu.au>2007-04-19 03:27:05 +0200
commit393f376f24bda4d5dd8745d45d1ff5ef7b31aab5 (patch)
tree252fabb66dc4f148f2cad2643453eb6f1cbb87cf /tests
parent3685be05ec480a3829383c6ac29a518f16ac1e20 (diff)
downloadmetatile-393f376f24bda4d5dd8745d45d1ff5ef7b31aab5.tar
metatile-393f376f24bda4d5dd8745d45d1ff5ef7b31aab5.zip
Parameterise StackSet by two index types, rather than breaking abstraction
darcs-hash:20070419012705-9c5c1-3aa97e02123af08c3f4500c9e9c3bb7ab4121652
Diffstat (limited to 'tests')
-rw-r--r--tests/Properties.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/Properties.hs b/tests/Properties.hs
index e69c7f9..7eefe67 100644
--- a/tests/Properties.hs
+++ b/tests/Properties.hs
@@ -17,11 +17,11 @@ import Data.Map (keys,elems)
-- QuickCheck properties for the StackSet
-- | Height of stack 'n'
-height :: WorkspaceId -> StackSet a -> Int
+height :: Int -> T -> Int
height i w = length (index i w)
-- build (non-empty) StackSets with between 1 and 100 stacks
-instance (Ord a, Arbitrary a) => Arbitrary (StackSet a) where
+instance (Integral i, Integral j, Ord a, Arbitrary a) => Arbitrary (StackSet i j a) where
arbitrary = do
sz <- choose (1,20)
n <- choose (0,sz-1)
@@ -58,7 +58,7 @@ prop_peekmember x = case peek x of
Nothing -> True {- then we don't know anything -}
where _ = x :: T
-type T = StackSet Int
+type T = StackSet Int Int Int
prop_delete_uniq i x = not (member i x) ==> delete i x == x
where _ = x :: T