diff options
author | Max Rabkin <max.rabkin@gmail.com> | 2009-09-29 18:04:20 +0200 |
---|---|---|
committer | Max Rabkin <max.rabkin@gmail.com> | 2009-09-29 18:04:20 +0200 |
commit | 4b3ac1ac0388f7220a5e533c375632a1af2bba9d (patch) | |
tree | 70e8c390693e557d2e299d0fb01d381e408b6fb6 | |
parent | 151f1726ac1efea5ea9686eab5cb72f075a6d352 (diff) | |
download | XMonadContrib-4b3ac1ac0388f7220a5e533c375632a1af2bba9d.tar.gz XMonadContrib-4b3ac1ac0388f7220a5e533c375632a1af2bba9d.tar.xz XMonadContrib-4b3ac1ac0388f7220a5e533c375632a1af2bba9d.zip |
move updateSel from test_Selective into Selective
Ignore-this: 6636f2f2d5aa15a6d0ef6d45ee38aa42
darcs-hash:20090929160420-a5338-e359279c8accbf1db6210b862f319e283d0c8bf3.gz
-rw-r--r-- | tests/test_Selective.hs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/test_Selective.hs b/tests/test_Selective.hs index ffdb971..790ce14 100644 --- a/tests/test_Selective.hs +++ b/tests/test_Selective.hs @@ -29,12 +29,12 @@ arbPos = (+1) . abs <$> arbitrary prop_select_length sel (stk :: Stack Int) = (length . integrate $ select sel' stk) == ((nMaster sel' + nRest sel') `min` length (integrate stk)) where - sel' = updateSel sel stk + sel' = update sel stk -- update normalizes selections (is idempotent) -prop_update_idem sel (stk :: Stack Int) = sel' == updateSel sel' stk +prop_update_idem sel (stk :: Stack Int) = sel' == update sel' stk where - sel' = updateSel sel stk + sel' = update sel stk -- select selects the master pane prop_select_master sel (stk :: Stack Int) = @@ -43,7 +43,7 @@ prop_select_master sel (stk :: Stack Int) = -- the focus should always be selected in normalized selections prop_select_focus sel (stk :: Stack Int) = focus stk == (focus $ select sel' stk) where - sel' = updateSel sel stk + sel' = update sel stk -- select doesn't change order (or duplicate elements) -- relies on the Arbitrary instance for Stack Int generating increasing stacks @@ -54,21 +54,21 @@ prop_select_increasing sel (stk :: Stack Int) = -- moving the focus to a window that's already selected doesn't change the selection prop_update_focus_up sel (stk :: Stack Int) x' = (length (up stk) >= x) && ((up stk !! (x-1)) `elem` integrate stk') ==> - sel' == updateSel sel' (iterate focusUp stk !! x) + sel' == update sel' (iterate focusUp stk !! x) where x = 1 + abs x' - sel' = updateSel sel stk + sel' = update sel stk stk' = select sel' stk prop_update_focus_down sel (stk :: Stack Int) x' = (length (down stk) >= x) && ((down stk !! (x-1)) `elem` integrate stk') ==> - sel' == updateSel sel' (iterate focusDown stk !! x) + sel' == update sel' (iterate focusDown stk !! x) where x = 1 + abs x' - sel' = updateSel sel stk + sel' = update sel stk stk' = select sel' stk -upSel sel stk = let sel' = updateSel sel stk in (sel', select sel' stk) +upSel sel stk = let sel' = update sel stk in (sel', select sel' stk) focusUp stk = stk { up=tail (up stk), focus=head (up stk), down=focus stk:down stk } focusDown stk = stk { down=tail (down stk), focus=head (down stk), up=focus stk:up stk } |