mirror of
https://github.com/xmonad/xmonad.git
synced 2025-07-31 04:01:52 -07:00
QuickCheck filter preserves order
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
{-# OPTIONS -fglasgow-exts #-}
|
||||
|
||||
import StackSet hiding (filter)
|
||||
import qualified StackSet as S (filter)
|
||||
import Operations (tile)
|
||||
|
||||
import Debug.Trace
|
||||
@@ -401,6 +402,15 @@ prop_delete_focus_not_end (x :: T) =
|
||||
where
|
||||
Just n = peek x
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- filter
|
||||
|
||||
-- preserve order
|
||||
prop_filter_order (x :: T) =
|
||||
case stack $ workspace $ current x of
|
||||
Nothing -> True
|
||||
Just s@(Stack i _ _) -> integrate' (S.filter (/= i) s) == filter (/= i) (integrate' (Just s))
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- swapUp, swapDown, swapMaster: reordiring windows
|
||||
|
||||
@@ -548,6 +558,8 @@ main = do
|
||||
,("delete last/focus up", mytest prop_delete_focus_end)
|
||||
,("delete ~last/focus down", mytest prop_delete_focus_not_end)
|
||||
|
||||
,("filter preserves order", mytest prop_filter_order)
|
||||
|
||||
,("swapMaster: invariant", mytest prop_swap_master_I)
|
||||
,("swapUp: invariant" , mytest prop_swap_left_I)
|
||||
,("swapDown: invariant", mytest prop_swap_right_I)
|
||||
|
Reference in New Issue
Block a user