summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDevin Mullins <me@twifkak.com>2008-09-11 07:39:09 +0200
committerDevin Mullins <me@twifkak.com>2008-09-11 07:39:09 +0200
commitbfefeedb40f30db5142a31603a62def123cd1794 (patch)
treec53f64016659b2c88e7ce5aaf3e81e2fdc91bd1c /tests
parent5c31b75fb41a124e4280e166d6d8816d9d2c4b48 (diff)
downloadmetatile-bfefeedb40f30db5142a31603a62def123cd1794.tar
metatile-bfefeedb40f30db5142a31603a62def123cd1794.zip
add W.shiftMaster, fix float/tile-reordering bug
darcs-hash:20080911053909-78224-d050fdbedac4eb39a96f30ec0679a9b67d274091
Diffstat (limited to 'tests')
-rw-r--r--tests/Properties.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/Properties.hs b/tests/Properties.hs
index 9b0e83c..8a8ab04 100644
--- a/tests/Properties.hs
+++ b/tests/Properties.hs
@@ -528,6 +528,18 @@ prop_shift_reversible i (x :: T) =
y = swapMaster x
n = tag (workspace $ current y)
+------------------------------------------------------------------------
+-- shiftMaster
+
+-- focus/local/idempotent same as swapMaster:
+prop_shift_master_focus (x :: T) = peek x == (peek $ shiftMaster x)
+prop_shift_master_local (x :: T) = hidden_spaces x == hidden_spaces (shiftMaster x)
+prop_shift_master_idempotent (x :: T) = shiftMaster (shiftMaster x) == shiftMaster x
+-- ordering is constant modulo the focused window:
+prop_shift_master_ordering (x :: T) = case peek x of
+ Nothing -> True
+ Just m -> L.delete m (index x) == L.delete m (index $ shiftMaster x)
+
-- ---------------------------------------------------------------------
-- shiftWin
@@ -933,6 +945,11 @@ main = do
,("swapUp is local" , mytest prop_swap_left_local)
,("swapDown is local" , mytest prop_swap_right_local)
+ ,("shiftMaster id on focus", mytest prop_shift_master_focus)
+ ,("shiftMaster is local", mytest prop_shift_master_local)
+ ,("shiftMaster is idempotent", mytest prop_shift_master_idempotent)
+ ,("shiftMaster preserves ordering", mytest prop_shift_master_ordering)
+
,("shift: invariant" , mytest prop_shift_I)
,("shift is reversible" , mytest prop_shift_reversible)
,("shiftWin: invariant" , mytest prop_shift_win_I)