summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevin Mullins <me@twifkak.com>2007-10-06 09:31:29 +0200
committerDevin Mullins <me@twifkak.com>2007-10-06 09:31:29 +0200
commit6c3000d3ca62e3f1e4bee36b843f160383ed1b36 (patch)
treeaf84f54a4b9ae2c7bcb1d187b461de41acbec7b0
parent9c7c063a72728b2a1780c3d5c988ff8e85322d51 (diff)
downloadmetatile-6c3000d3ca62e3f1e4bee36b843f160383ed1b36.tar
metatile-6c3000d3ca62e3f1e4bee36b843f160383ed1b36.zip
add mapWorkspace tests
(just completely duplicated the two mapLayout tests :) darcs-hash:20071006073129-78224-d1303612fd8e2f9ede740831b031a88914ee833a
-rw-r--r--tests/Properties.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/Properties.hs b/tests/Properties.hs
index 7a05ecd..a7ce18f 100644
--- a/tests/Properties.hs
+++ b/tests/Properties.hs
@@ -610,6 +610,12 @@ prop_rename1 (x::T) o n = o `tagMember` x && not (n `tagMember` x) ==>
prop_ensure (x :: T) l xs = let y = ensureTags l xs x
in and [ n `tagMember` y | n <- xs ]
+prop_mapWorkspaceId (x::T) = x == mapWorkspace id x
+
+prop_mapWorkspaceInverse (x::T) = x == mapWorkspace predTag (mapWorkspace succTag x)
+ where predTag w = w { tag = pred $ tag w }
+ succTag w = w { tag = succ $ tag w }
+
prop_mapLayoutId (x::T) = x == mapLayout id x
prop_mapLayoutInverse (x::T) = x == mapLayout pred (mapLayout succ x)
@@ -752,6 +758,8 @@ main = do
,("renaming works", mytest prop_rename1)
,("ensure works", mytest prop_ensure)
+ ,("mapWorkspace id", mytest prop_mapWorkspaceId)
+ ,("mapWorkspace inverse", mytest prop_mapWorkspaceInverse)
,("mapLayout id", mytest prop_mapLayoutId)
,("mapLayout inverse", mytest prop_mapLayoutInverse)