summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDon Stewart <dons@galois.com>2008-02-25 19:03:50 +0100
committerDon Stewart <dons@galois.com>2008-02-25 19:03:50 +0100
commit75f754d730edd41185716b21977d4ac4641995ad (patch)
treec4de98cda1f08af02bb7a2198c3372f70f1a6c6f /tests
parentd81c930991f6229fba9c6ae015b68d411ce594af (diff)
downloadmetatile-75f754d730edd41185716b21977d4ac4641995ad.tar
metatile-75f754d730edd41185716b21977d4ac4641995ad.zip
incorrect invariant test for greedyView
darcs-hash:20080225180350-cba2c-95b57af5f105496a17148c49578ae83d1e0f0a35
Diffstat (limited to 'tests')
-rw-r--r--tests/Properties.hs10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/Properties.hs b/tests/Properties.hs
index e96b03f..ec2e32a 100644
--- a/tests/Properties.hs
+++ b/tests/Properties.hs
@@ -139,7 +139,7 @@ prop_view_I (n :: NonNegative Int) (x :: T) =
n `tagMember` x ==> invariant $ view (fromIntegral n) x
prop_greedyView_I (n :: NonNegative Int) (x :: T) =
- n `tagMember` x ==> invariant $ view (fromIntegral n) x
+ n `tagMember` x ==> invariant $ greedyView (fromIntegral n) x
prop_focusUp_I (n :: NonNegative Int) (x :: T) =
invariant $ foldr (const focusUp) x [1..n]
@@ -236,6 +236,13 @@ prop_greedyView_current (x :: T) (n :: NonNegative Int) = i `tagMember` x ==>
where
i = fromIntegral n
+-- greedyView leaves things unchanged for invalid workspaces
+prop_greedyView_current_id (x :: T) (n :: NonNegative Int) = not (i `tagMember` x) ==>
+ tag (workspace $ current (greedyView i x)) == j
+ where
+ i = fromIntegral n
+ j = tag (workspace (current x))
+
-- greedyView *only* sets the current workspace, and touches Xinerama.
-- no workspace contents will be changed.
prop_greedyView_local (x :: T) (n :: NonNegative Int) = i `tagMember` x ==>
@@ -675,6 +682,7 @@ main = do
,("greedyView : invariant" , mytest prop_greedyView_I)
,("greedyView sets current" , mytest prop_greedyView_current)
+ ,("greedyView is safe " , mytest prop_greedyView_current_id)
,("greedyView idempotent" , mytest prop_greedyView_idem)
,("greedyView reversible" , mytest prop_greedyView_reversible)
,("greedyView is local" , mytest prop_greedyView_local)