mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 03:20:21 -07:00
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.
24 lines
496 B
Haskell
24 lines
496 B
Haskell
{-# OPTIONS_GHC -Wall #-}
|
|
module CycleRecentWS where
|
|
|
|
import Test.Hspec
|
|
import Test.Hspec.QuickCheck
|
|
import Test.QuickCheck
|
|
|
|
import XMonad.Actions.CycleRecentWS (unView)
|
|
import XMonad.StackSet (view, mapLayout)
|
|
|
|
import Instances
|
|
import Utils (tags)
|
|
|
|
spec :: Spec
|
|
spec = do
|
|
prop "prop_unView" $ prop_unView
|
|
|
|
prop_unView :: T -> Property
|
|
prop_unView ss = conjoin
|
|
[ counterexample (show t) (unView ss (state (view t ss)) === state ss)
|
|
| t <- tags ss ]
|
|
where
|
|
state = mapLayout succ
|