2015-08-14 08:28:32 +00:00
|
|
|
module GhcPkgSpec where
|
|
|
|
|
2017-05-28 02:22:56 +00:00
|
|
|
import GhcMod.GhcPkg
|
|
|
|
import GhcMod.CabalHelper
|
|
|
|
import GhcMod.CustomPackageDb
|
2015-08-14 08:28:32 +00:00
|
|
|
import Test.Hspec
|
2015-08-17 05:03:32 +00:00
|
|
|
import System.Process (system)
|
2015-08-14 08:28:32 +00:00
|
|
|
|
|
|
|
import Dir
|
|
|
|
import TestUtils
|
|
|
|
|
|
|
|
spec :: Spec
|
|
|
|
spec = do
|
|
|
|
describe "getPackageDbStack'" $ do
|
|
|
|
it "fixes out of sync custom pkg-db stack" $ do
|
|
|
|
withDirectory_ "test/data/custom-cradle" $ do
|
|
|
|
_ <- system "cabal configure"
|
|
|
|
(s, s') <- runD $ do
|
|
|
|
Just stack <- getCustomPkgDbStack
|
|
|
|
withCabal $ do
|
|
|
|
stack' <- getPackageDbStack
|
|
|
|
return (stack, stack')
|
|
|
|
s' `shouldBe` s
|