mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 03:20:21 -07:00
added prop_select_two_consec to test_Selective.hs
This commit is contained in:
parent
6ef8fd353d
commit
d330dcae24
@ -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'
|
||||
|
Loading…
x
Reference in New Issue
Block a user