From 75f754d730edd41185716b21977d4ac4641995ad Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Mon, 25 Feb 2008 19:03:50 +0100 Subject: incorrect invariant test for greedyView darcs-hash:20080225180350-cba2c-95b57af5f105496a17148c49578ae83d1e0f0a35 --- tests/Properties.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3