From eff77d1f3167a667232beb315613b526a40fab91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Mon, 19 May 2014 01:29:49 +0200 Subject: [PATCH] Add test for sandbox compatibility with ghc < 7.8 --- test/GhcPkgSpec.hs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/GhcPkgSpec.hs b/test/GhcPkgSpec.hs index 1859829..af39235 100644 --- a/test/GhcPkgSpec.hs +++ b/test/GhcPkgSpec.hs @@ -1,6 +1,8 @@ +{-# LANGUAGE CPP #-} module GhcPkgSpec where import Language.Haskell.GhcMod.GhcPkg +import Language.Haskell.GhcMod.Types import System.Directory import System.FilePath (()) @@ -9,6 +11,13 @@ import Test.Hspec spec :: Spec spec = do describe "getSandboxDb" $ do +-- ghc < 7.8 +#if !MIN_VERSION_ghc(7,8,0) + it "does include a sandbox with ghc < 7.8" $ do + cwd <- getCurrentDirectory + getPackageDbStack "test/data/" `shouldReturn` [GlobalDb, PackageDb $ cwd "test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d"] +#endif + it "parses a config file and extracts sandbox package db" $ do cwd <- getCurrentDirectory pkgDb <- getSandboxDb "test/data/"