xmonad-contrib/tests/CycleRecentWS.hs
Tomas Janousek 24786c6d04 X.A.CycleRecentWS: Add property test for unView
Scary looking code better be tested. :-)

(For the record, the test did find an issue that is already fixed in the
previous commit.)
2021-06-02 08:32:34 +02:00

21 lines
432 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)
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 (view t ss) === ss) | t <- tags ss ]