summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDon Stewart <dons@cse.unsw.edu.au>2007-04-11 10:15:00 +0200
committerDon Stewart <dons@cse.unsw.edu.au>2007-04-11 10:15:00 +0200
commit4ff0c6bda87f4ca82d2c5e3e78f8e7cfc20f3302 (patch)
treead0decc6f9409b8b4e136c9d223d3ed79bc99e16 /tests
parent344921c2341f5e2d87720ee4c047730ae78081a3 (diff)
downloadmetatile-4ff0c6bda87f4ca82d2c5e3e78f8e7cfc20f3302.tar
metatile-4ff0c6bda87f4ca82d2c5e3e78f8e7cfc20f3302.zip
and the tests still run
darcs-hash:20070411081500-9c5c1-de5c90255b488c617bee222ece8e4ff059a8a95a
Diffstat (limited to 'tests')
-rw-r--r--tests/Properties.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/Properties.hs b/tests/Properties.hs
index 4a4a4b2..1d464a7 100644
--- a/tests/Properties.hs
+++ b/tests/Properties.hs
@@ -1,3 +1,4 @@
+{-# OPTIONS -fglasgow-exts #-}
import StackSet
@@ -16,7 +17,7 @@ import Data.Map (keys,elems)
-- QuickCheck properties for the StackSet
-- | Height of stack 'n'
-height :: Int -> StackSet a -> Int
+height :: WorkspaceId -> StackSet a -> Int
height i w = length (index i w)
-- build (non-empty) StackSets with between 1 and 100 stacks
@@ -26,7 +27,7 @@ instance (Ord a, Arbitrary a) => Arbitrary (StackSet a) where
n <- choose (0,sz-1)
sc <- choose (1,sz)
ls <- vector sz
- return $ fromList (n,sc,ls)
+ return $ fromList (fromIntegral n,sc,ls)
coarbitrary = error "no coarbitrary for StackSet"
prop_id x = fromList (toList x) == x
@@ -73,7 +74,7 @@ prop_viewview r x =
let n = current x
sz = size x
i = r `mod` sz
- in view n (view i x) == x
+ in view n (view (fromIntegral i) x) == x
where _ = x :: T
@@ -96,8 +97,8 @@ prop_ws2screen_screen2ws x = (ws == ws') && (sc == sc')
sc = sort . keys $ screen2ws x
sc' = sort . elems $ ws2screen x
_ = x :: T
-
-prop_screenworkspace x = all test [0..((size x)-1)]
+
+prop_screenworkspace x = all test [0..((fromIntegral $ size x)-1)]
where test ws = case screen ws x of
Nothing -> True
Just sc -> workspace sc x == Just ws