To break cyclic import, this patch makes GhcPkg.hs independent from Monad.hs(refactoring for #244)
This removes `ghcPkgList`, `ghcPkgListEx` and `ghcPkgDbOpt`. I'm not sure this is a right way to do.
This commit is contained in:
@@ -1,18 +1,11 @@
|
||||
module GhcPkgSpec where
|
||||
|
||||
import Language.Haskell.GhcMod.Types
|
||||
import Language.Haskell.GhcMod.GhcPkg
|
||||
import Language.Haskell.GhcMod.Monad
|
||||
|
||||
import CoreMonad (liftIO)
|
||||
|
||||
import Control.Applicative
|
||||
import System.Directory
|
||||
import System.FilePath ((</>))
|
||||
import Test.Hspec
|
||||
|
||||
import Dir
|
||||
|
||||
spec :: Spec
|
||||
spec = do
|
||||
describe "getSandboxDb" $ do
|
||||
@@ -23,10 +16,3 @@ spec = do
|
||||
|
||||
it "throws an error if a config file is broken" $ do
|
||||
getSandboxDb "test/data/broken-sandbox" `shouldThrow` anyException
|
||||
|
||||
describe "getPackageDbPackages" $ do
|
||||
it "find a config file and extracts packages" $
|
||||
runGhcMod defaultOptions $ do
|
||||
sdb <- liftIO $ getSandboxDb "test/data/check-packageid"
|
||||
pkgs <- ghcPkgListEx [PackageDb sdb]
|
||||
liftIO $ pkgs `shouldBe` [("template-haskell","2.8.0.0","32d4f24abdbb6bf41272b183b2e23e9c")]
|
||||
|
||||
Reference in New Issue
Block a user