diff options
author | Don Stewart <dons@cse.unsw.edu.au> | 2007-04-19 02:12:01 +0200 |
---|---|---|
committer | Don Stewart <dons@cse.unsw.edu.au> | 2007-04-19 02:12:01 +0200 |
commit | 9478ed6fa9872e84b7d2cfe631623d0e1b890d5b (patch) | |
tree | 8003cadb26d76d1ea6942e44ea0c0ff3170c6ad8 | |
parent | 21c67ffb516d128755366a32f66d4cfb12360228 (diff) | |
download | xmonad-9478ed6fa9872e84b7d2cfe631623d0e1b890d5b.tar.gz xmonad-9478ed6fa9872e84b7d2cfe631623d0e1b890d5b.tar.xz xmonad-9478ed6fa9872e84b7d2cfe631623d0e1b890d5b.zip |
2 more properties for promote.
darcs-hash:20070419001201-9c5c1-7ab345797094d164e47185bebefe05b1add6e120.gz
-rw-r--r-- | tests/Properties.hs | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/Properties.hs b/tests/Properties.hs index 245f02f..e69c7f9 100644 --- a/tests/Properties.hs +++ b/tests/Properties.hs @@ -103,13 +103,25 @@ prop_screenworkspace x = all test [0..((fromIntegral $ size x)-1)] Nothing -> True Just sc -> workspace sc x == Just ws _ = x :: T +------------------------------------------------------------------------ +-- promote is idempotent prop_promote2 x = promote (promote x) == (promote x) where _ = x :: T -prop_promotefocus x = focus (promote x) == focus x -- focus doesn't change +-- focus doesn't change +prop_promotefocus x = focus (promote x) == focus x + where _ = x :: T + +-- screen certainly should't change +prop_promotecurrent x = current (promote x) == current x where _ = x :: T +-- promote doesn't mess with other windows +prop_promoterotate x b = focus (rotate dir (promote x)) == focus (rotate dir x) + where _ = x :: T + dir = if b then LT else GT + ------------------------------------------------------------------------ main :: IO () @@ -137,8 +149,11 @@ main = do ,("currentwsvisible ", mytest prop_currentwsvisible) ,("ws screen mapping", mytest prop_ws2screen_screen2ws) ,("screen/workspace ", mytest prop_screenworkspace) + ,("promote idempotent", mytest prop_promote2) - ,("promote/focus", mytest prop_promotefocus) + ,("promote focus", mytest prop_promotefocus) + ,("promote current", mytest prop_promotecurrent) + ,("promote only swaps", mytest prop_promoterotate) ] debug = False |