aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Schoelzel <kuser@gmx.de>2007-07-28 20:45:34 +0200
committerKarsten Schoelzel <kuser@gmx.de>2007-07-28 20:45:34 +0200
commit7fbbcb2190f19d230e1f02fee0ae20fde8387a89 (patch)
treee57d383adeaccf7e3bbaa56b3302a7aa908fc05c
parentca457329bf259a2404fc5fbd0918007868e6488a (diff)
downloadxmonad-7fbbcb2190f19d230e1f02fee0ae20fde8387a89.tar.gz
xmonad-7fbbcb2190f19d230e1f02fee0ae20fde8387a89.tar.xz
xmonad-7fbbcb2190f19d230e1f02fee0ae20fde8387a89.zip
QuickCheck filter preserves order
darcs-hash:20070728184534-eb3a1-68bbf44ab26db69a4aa75fb97cb516ebf6c963bb.gz
-rw-r--r--tests/Properties.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/Properties.hs b/tests/Properties.hs
index 452267f..589275a 100644
--- a/tests/Properties.hs
+++ b/tests/Properties.hs
@@ -1,6 +1,7 @@
{-# OPTIONS -fglasgow-exts #-}
import StackSet hiding (filter)
+import qualified StackSet as S (filter)
import Operations (tile)
import Debug.Trace
@@ -402,6 +403,15 @@ prop_delete_focus_not_end (x :: T) =
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
-- swap is trivially reversible
@@ -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)