From 1515ab198ec017dda9ae7460dcc88f013d967513 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 3 Jul 2015 16:19:41 +0300 Subject: [PATCH] Make tests compile with LTS 2 --- src/test/Stack/DotSpec.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/Stack/DotSpec.hs b/src/test/Stack/DotSpec.hs index daa721d40a..610e9daef5 100644 --- a/src/test/Stack/DotSpec.hs +++ b/src/test/Stack/DotSpec.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} -- | Test suite for Stack.Dot module Stack.DotSpec where @@ -14,7 +15,9 @@ import Options.Applicative (execParserPure,idm,prefs,info,getParseResu import Stack.Types import Test.Hspec import Test.Hspec.QuickCheck (prop) +#if MIN_VERSION_QuickCheck(2,8,0) import Test.QuickCheck (forAll,sublistOf) +#endif import Stack.Dot @@ -42,6 +45,7 @@ spec = do resultGraph' = resolveDependencies Nothing graph' stubLoader fmap Map.size resultGraph' `shouldBe` fmap ((+1) . Map.size) resultGraph +#if MIN_VERSION_QuickCheck(2,8,0) prop "requested packages are pruned" $ do let resolvedGraph = runIdentity (resolveDependencies Nothing graph stubLoader) allPackages g = Set.map show (Map.keysSet g `Set.union` F.fold g) @@ -56,6 +60,7 @@ spec = do forAll (sublistOf (Set.toList (allPackages resolvedGraph))) $ \toPrune -> let pruned = pruneGraph [pkgName "one", pkgName "two"] toPrune resolvedGraph in null (Map.keys (orphans pruned) \\ [pkgName "one", pkgName "two"]) +#endif where graphElem e graph = Set.member e . Set.unions . Map.elems $ graph