test for Cabal 1.18.0.
This commit is contained in:
parent
318b376b30
commit
d37e1592d4
@ -35,23 +35,23 @@ spec = do
|
|||||||
|
|
||||||
it "finds a sandbox" $ do
|
it "finds a sandbox" $ do
|
||||||
withDirectory "test/data/subdir1/subdir2" $ \dir -> do
|
withDirectory "test/data/subdir1/subdir2" $ \dir -> do
|
||||||
res <- relativeCradle dir <$> findCradle Nothing "7.6.2"
|
res <- relativeCradle dir <$> findCradle Nothing "7.6.3"
|
||||||
res `shouldBe` Cradle {
|
res `shouldBe` Cradle {
|
||||||
cradleCurrentDir = "test" </> "data" </> "subdir1" </> "subdir2"
|
cradleCurrentDir = "test" </> "data" </> "subdir1" </> "subdir2"
|
||||||
, cradleCabalDir = Just ("test" </> "data")
|
, cradleCabalDir = Just ("test" </> "data")
|
||||||
, cradleCabalFile = Just ("test" </> "data" </> "cabalapi.cabal")
|
, cradleCabalFile = Just ("test" </> "data" </> "cabalapi.cabal")
|
||||||
, cradlePackageConf = Just ("test" </> "data" </> "cabal-dev" </> "packages-7.6.2.conf")
|
, cradlePackageConf = Just ("test" </> "data" </> ".cabal-sandbox" </> "i386-osx-ghc-7.6.3-packages.conf.d")
|
||||||
}
|
}
|
||||||
|
|
||||||
it "finds a sandbox if exists" $ do
|
it "finds a sandbox if exists" $ do
|
||||||
withDirectory "/" $ \dir -> do
|
withDirectory "/" $ \dir -> do
|
||||||
curDir <- canonicalizePath "/"
|
curDir <- canonicalizePath "/"
|
||||||
res <- relativeCradle dir <$> findCradle (Just $ addTrailingPathSeparator dir ++ ("test" </> "data" </> "cabal-dev")) "7.6.2"
|
res <- relativeCradle dir <$> findCradle (Just $ addTrailingPathSeparator dir ++ ("test" </> "data" </> ".cabal-sandbox")) "7.6.3"
|
||||||
res `shouldBe` Cradle {
|
res `shouldBe` Cradle {
|
||||||
cradleCurrentDir = curDir
|
cradleCurrentDir = curDir
|
||||||
, cradleCabalDir = Nothing
|
, cradleCabalDir = Nothing
|
||||||
, cradleCabalFile = Nothing
|
, cradleCabalFile = Nothing
|
||||||
, cradlePackageConf = Just ("test" </> "data" </> "cabal-dev" </> "packages-7.6.2.conf")
|
, cradlePackageConf = Just ("test" </> "data" </> ".cabal-sandbox" </> "i386-osx-ghc-7.6.3-packages.conf.d")
|
||||||
}
|
}
|
||||||
|
|
||||||
it "throws an error if the sandbox does not exist" $ do
|
it "throws an error if the sandbox does not exist" $ do
|
||||||
|
25
test/data/cabal.sandbox.config
Normal file
25
test/data/cabal.sandbox.config
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
-- This is a Cabal package environment file.
|
||||||
|
-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY.
|
||||||
|
-- Please create a 'cabal.config' file in the same directory
|
||||||
|
-- if you want to change the default settings for this sandbox.
|
||||||
|
|
||||||
|
|
||||||
|
local-repo: /Users/kazu/work/ghc-mod/test/data/.cabal-sandbox/packages
|
||||||
|
logs-dir: /Users/kazu/work/ghc-mod/test/data/.cabal-sandbox/logs
|
||||||
|
world-file: /Users/kazu/work/ghc-mod/test/data/.cabal-sandbox/world
|
||||||
|
user-install: False
|
||||||
|
package-db: /Users/kazu/work/ghc-mod/test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d
|
||||||
|
build-summary: /Users/kazu/work/ghc-mod/test/data/.cabal-sandbox/logs/build.log
|
||||||
|
|
||||||
|
install-dirs
|
||||||
|
prefix: /Users/kazu/work/ghc-mod/test/data/.cabal-sandbox
|
||||||
|
bindir: $prefix/bin
|
||||||
|
libdir: $prefix/lib
|
||||||
|
libsubdir: $arch-$os-$compiler/$pkgid
|
||||||
|
libexecdir: $prefix/libexec
|
||||||
|
datadir: $prefix/share
|
||||||
|
datasubdir: $arch-$os-$compiler/$pkgid
|
||||||
|
docdir: $datadir/doc/$arch-$os-$compiler/$pkgid
|
||||||
|
htmldir: $docdir/html
|
||||||
|
haddockdir: $htmldir
|
||||||
|
sysconfdir: $prefix/etc
|
Loading…
Reference in New Issue
Block a user