diff options
author | Don Stewart <dons@cse.unsw.edu.au> | 2007-04-19 00:42:36 +0200 |
---|---|---|
committer | Don Stewart <dons@cse.unsw.edu.au> | 2007-04-19 00:42:36 +0200 |
commit | 52bbce6a3e6de7cde3f5246d64867f8ba446c647 (patch) | |
tree | 958f176ea788830e36b85be7d0bfb429bdf5ea6c /tests | |
parent | 190c9f3be4418e1ba26eef4750b8a123357ba35b (diff) | |
download | metatile-52bbce6a3e6de7cde3f5246d64867f8ba446c647.tar metatile-52bbce6a3e6de7cde3f5246d64867f8ba446c647.zip |
Promote now swaps focused window with master window
This means other windows are unaffected.
The change from the previous cycling behaviour was felt necessary, since
cycling isn't a terribly useful operation.
Some properties that hold:
focus is unchanged by promotion
promote is idempotent (promoting twice does nothing)
the focused and master window will swap their positions in the stack
darcs-hash:20070418224236-9c5c1-4539f9f397e181f91dc9743e3ffac4b5796c0fac
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Properties.hs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/Properties.hs b/tests/Properties.hs index 1d464a7..245f02f 100644 --- a/tests/Properties.hs +++ b/tests/Properties.hs @@ -6,7 +6,7 @@ import Data.Maybe import System.Environment import Control.Exception (assert) import Control.Monad -import Test.QuickCheck +import Test.QuickCheck hiding (promote) import System.IO import System.Random import Text.Printf @@ -104,6 +104,12 @@ prop_screenworkspace x = all test [0..((fromIntegral $ size x)-1)] Just sc -> workspace sc x == Just ws _ = x :: T +prop_promote2 x = promote (promote x) == (promote x) + where _ = x :: T + +prop_promotefocus x = focus (promote x) == focus x -- focus doesn't change + where _ = x :: T + ------------------------------------------------------------------------ main :: IO () @@ -131,6 +137,8 @@ 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) ] debug = False |