aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMax Rabkin <max.rabkin@gmail.com>2009-10-01 17:58:53 +0200
committerMax Rabkin <max.rabkin@gmail.com>2009-10-01 17:58:53 +0200
commitbcf6914fe0bd5386c207139df1ee39186573b5a8 (patch)
tree0a538a9b50dbf6c2dba575cd390816e54b246c4f /tests
parentf460b9018f30a702e15b5968d2fd816657a2dc0d (diff)
downloadXMonadContrib-bcf6914fe0bd5386c207139df1ee39186573b5a8.tar.gz
XMonadContrib-bcf6914fe0bd5386c207139df1ee39186573b5a8.tar.xz
XMonadContrib-bcf6914fe0bd5386c207139df1ee39186573b5a8.zip
added prop_select_two_consec to test_Selective.hs
Ignore-this: 80e2b5d8658dc053c66993be970e6247 darcs-hash:20091001155853-a5338-0520bb8e07f2ac797f4970730f414a36e3fdf4b0.gz
Diffstat (limited to 'tests')
-rw-r--r--tests/test_Selective.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_Selective.hs b/tests/test_Selective.hs
index 15ea5c0..186f904 100644
--- a/tests/test_Selective.hs
+++ b/tests/test_Selective.hs
@@ -5,7 +5,7 @@
-- L.LimitWindows.
import XMonad.Layout.LimitWindows
-import XMonad.StackSet hiding (focusUp, focusDown)
+import XMonad.StackSet hiding (focusUp, focusDown, filter)
import Control.Applicative ((<$>))
import Test.QuickCheck
import Control.Arrow (second)
@@ -52,6 +52,12 @@ prop_select_increasing sel (stk :: Stack Int) =
let res = integrate $ select sel stk
in and . zipWith (<) res $ tail res
+-- selection has the form [0..l] ++ [m..n]
+-- relies on the Arbitrary instance for Stack Int generating stacks like [0..k]
+prop_select_two_consec sel (stk :: Stack Int) =
+ let wins = integrate $ select sel stk
+ in (length . filter not . zipWith ((==) . (+1)) wins $ tail wins) <= 1
+
-- update preserves invariants on selections
prop_update_nm sel (stk :: Stack Int) = nMaster (update sel stk) >= 0
prop_update_start sel (stk :: Stack Int) = nMaster sel' <= start sel'