Bring spec up to speed

This commit is contained in:
Daniel Gröber 2014-04-17 23:49:23 +02:00
parent 2381f6e1ab
commit 1639a7b2e0
7 changed files with 12 additions and 42 deletions

View File

@ -27,7 +27,7 @@ Extra-Source-Files: ChangeLog
test/data/*.cabal
test/data/*.hs
test/data/cabal.sandbox.config.in
test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/dummy
test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/Cabal-1.18.1.3-2b161c6bf77657aa17e1681d83cb051b.conf
test/data/broken-cabal/*.cabal
test/data/broken-sandbox/*.cabal
test/data/broken-sandbox/cabal.sandbox.config

View File

@ -38,8 +38,10 @@ spec = do
, includeDirs = map (toRelativeDir dir) (includeDirs res)
}
if ghcVersion < 706
then res' `shouldBe` CompilerOptions {ghcOptions = ["-global-package-conf", "-no-user-package-conf","-package-conf",cwd </> "test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d","-XHaskell98"], includeDirs = ["test/data","test/data/dist/build","test/data/dist/build/autogen","test/data/subdir1/subdir2","test/data/test"], depPackages = [("Cabal", Nothing), ("base", Nothing) , ("template-haskell", Nothing)]}
else res' `shouldBe` CompilerOptions {ghcOptions = ["-global-package-db", "-no-user-package-db","-package-db",cwd </> "test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d","-XHaskell98"], includeDirs = ["test/data","test/data/dist/build","test/data/dist/build/autogen","test/data/subdir1/subdir2","test/data/test"], depPackages = [("Cabal", Nothing), ("base", Nothing) , ("template-haskell", Nothing)]}
then ghcOptions res' `shouldBe` ["-global-package-conf", "-no-user-package-conf","-package-conf",cwd </> "test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d","-XHaskell98"]
else ghcOptions res' `shouldBe` ["-global-package-db", "-no-user-package-db","-package-db",cwd </> "test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d","-XHaskell98"]
includeDirs res' `shouldBe` ["test/data","test/data/dist/build","test/data/dist/build/autogen","test/data/subdir1/subdir2","test/data/test"]
depPackages res' `shouldSatisfy` (("Cabal", "1.18.1.3", "2b161c6bf77657aa17e1681d83cb051b")`elem`)
describe "cabalDependPackages" $ do

View File

@ -22,7 +22,6 @@ spec = do
, cradleRootDir = curDir
, cradleCabalFile = Nothing
, cradlePkgDbStack = [GlobalDb]
, cradlePackages = []
}
it "finds a cabal file and a sandbox" $ do
cwd <- getCurrentDirectory
@ -33,7 +32,6 @@ spec = do
, cradleRootDir = "test" </> "data"
, cradleCabalFile = Just ("test" </> "data" </> "cabalapi.cabal")
, cradlePkgDbStack = [GlobalDb, PackageDb (cwd </> "test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d")]
, cradlePackages = []
}
it "works even if a sandbox config file is broken" $ do
withDirectory "test/data/broken-sandbox" $ \dir -> do
@ -43,7 +41,6 @@ spec = do
, cradleRootDir = "test" </> "data" </> "broken-sandbox"
, cradleCabalFile = Just ("test" </> "data" </> "broken-sandbox" </> "dummy.cabal")
, cradlePkgDbStack = [GlobalDb, UserDb]
, cradlePackages = []
}
relativeCradle :: FilePath -> Cradle -> Cradle

View File

@ -23,5 +23,6 @@ spec = do
describe "getPackageDbPackages" $ do
it "find a config file and extracts packages" $ do
pkgs <- getPackageDbPackages "test/data/check-packageid"
pkgs `shouldSatisfy` (\x -> length x >= 1)
sdb <- getSandboxDb "test/data/check-packageid"
pkgs <- ghcPkgListEx [PackageDb sdb]
pkgs `shouldBe` [("template-haskell","2.8.0.0","32d4f24abdbb6bf41272b183b2e23e9c")]

View File

@ -0,0 +1,4 @@
name: Cabal
version: 1.18.1.3
id: Cabal-1.18.1.3-2b161c6bf77657aa17e1681d83cb051b
exposed: True

View File

@ -1,37 +1,4 @@
name: template-haskell
version: 2.8.0.0
id: template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c
license: BSD3
copyright:
maintainer: libraries@haskell.org
stability:
homepage:
package-url:
synopsis:
description: Facilities for manipulating Haskell source code using Template Haskell.
category:
author:
exposed: True
exposed-modules: Language.Haskell.TH.Syntax
Language.Haskell.TH.PprLib Language.Haskell.TH.Ppr
Language.Haskell.TH.Lib Language.Haskell.TH.Quote
Language.Haskell.TH
hidden-modules:
trusted: False
import-dirs: /usr/lib64/ghc-7.6.3/template-haskell-2.8.0.0
library-dirs: /usr/lib64/ghc-7.6.3/template-haskell-2.8.0.0
hs-libraries: HStemplate-haskell-2.8.0.0
extra-libraries:
extra-ghci-libraries:
include-dirs:
includes:
depends: base-4.6.0.1-2bc8d09dc7b7883c4b97d1eb4a9d4ac8
containers-0.5.0.0-120bacdd7a06bf9f1f601811aa72d6c3
pretty-1.1.1.0-65070790589ca7952412e425f427ac56
hugs-options:
cc-options:
ld-options:
framework-dirs:
frameworks:
haddock-interfaces: /usr/share/doc/ghc-7.6.3/html/libraries/template-haskell-2.8.0.0/template-haskell.haddock
haddock-html: /usr/share/doc/ghc-7.6.3/html/libraries/template-haskell-2.8.0.0