mirror of
https://github.com/xmonad/xmonad.git
synced 2025-07-25 17:21:52 -07:00
Make quickcheck-classes dependency optional
This commit is contained in:
@@ -1,19 +1,23 @@
|
||||
{-# LANGUAGE ScopedTypeVariables #-}
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
||||
{-# LANGUAGE ScopedTypeVariables #-}
|
||||
module Properties.Stack where
|
||||
|
||||
import Test.QuickCheck
|
||||
import Test.QuickCheck.Classes (
|
||||
Laws (lawsTypeclass, lawsProperties), Proxy1 (Proxy1),
|
||||
foldableLaws, traversableLaws,
|
||||
)
|
||||
import Instances
|
||||
|
||||
import XMonad.StackSet hiding (filter)
|
||||
import qualified XMonad.StackSet as S (filter)
|
||||
|
||||
import Data.Maybe
|
||||
|
||||
#ifdef VERSION_quickcheck_classes
|
||||
import Test.QuickCheck.Classes (
|
||||
Laws (lawsTypeclass, lawsProperties), Proxy1 (Proxy1),
|
||||
foldableLaws, traversableLaws,
|
||||
)
|
||||
import Data.Functor.Classes (Eq1 (liftEq), Show1 (liftShowsPrec))
|
||||
#endif
|
||||
|
||||
|
||||
-- The list returned by index should be the same length as the actual
|
||||
@@ -57,6 +61,7 @@ prop_differentiate xs =
|
||||
where _ = xs :: [Int]
|
||||
|
||||
|
||||
#ifdef VERSION_quickcheck_classes
|
||||
-- Check type class laws of 'Data.Foldable.Foldable' and 'Data.Traversable.Traversable'.
|
||||
newtype TestStack a = TestStack (Stack a)
|
||||
deriving (Eq, Read, Show, Foldable, Functor)
|
||||
@@ -102,3 +107,6 @@ prop_laws_Stack =
|
||||
(\(name, prop) ->
|
||||
("Stack: " <> lawsTypeclass laws <> ": " <> name, prop))
|
||||
(lawsProperties laws)
|
||||
#else
|
||||
prop_laws_Stack = []
|
||||
#endif
|
||||
|
@@ -61,6 +61,8 @@ flag generatemanpage
|
||||
manual: True
|
||||
description: Build the tool for generating the man page
|
||||
|
||||
flag quickcheck-classes
|
||||
|
||||
library
|
||||
exposed-modules: XMonad
|
||||
XMonad.Config
|
||||
@@ -137,10 +139,13 @@ test-suite properties
|
||||
hs-source-dirs: tests
|
||||
build-depends: base
|
||||
, QuickCheck >= 2
|
||||
, quickcheck-classes >= 0.4.3
|
||||
, X11
|
||||
, containers
|
||||
, xmonad
|
||||
|
||||
if flag(quickcheck-classes)
|
||||
-- no quickcheck-classes in LTS-12
|
||||
build-depends: quickcheck-classes >= 0.4.3
|
||||
|
||||
if flag(pedantic)
|
||||
ghc-options: -Werror
|
||||
|
Reference in New Issue
Block a user