mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-01 04:31:52 -07:00
X.A.CycleRecentWS: Simplify/fix unView
To make this more "obviously correct", make it resemble the `view` implementation, just do the exact reverse. Now the only complex bit is the "undelete" operation. This also fixes another issue: state was only preserved in the focused workspace, but it may have changed in another visible workspace as well. The property test is updated to test this.
This commit is contained in:
@@ -6,7 +6,7 @@ import Test.Hspec.QuickCheck
|
||||
import Test.QuickCheck
|
||||
|
||||
import XMonad.Actions.CycleRecentWS (unView)
|
||||
import XMonad.StackSet (view)
|
||||
import XMonad.StackSet (view, mapLayout)
|
||||
|
||||
import Instances
|
||||
import Utils (tags)
|
||||
@@ -17,4 +17,7 @@ spec = do
|
||||
|
||||
prop_unView :: T -> Property
|
||||
prop_unView ss = conjoin
|
||||
[ counterexample (show t) (unView ss (view t ss) === ss) | t <- tags ss ]
|
||||
[ counterexample (show t) (unView ss (state (view t ss)) === state ss)
|
||||
| t <- tags ss ]
|
||||
where
|
||||
state = mapLayout succ
|
||||
|
Reference in New Issue
Block a user