diff --git a/test/Main.hs b/test/Main.hs index dbec67a..8eea411 100644 --- a/test/Main.hs +++ b/test/Main.hs @@ -5,12 +5,14 @@ import Test.Hspec import System.Process main = do - let sandboxes = [ "test/data", "test/data/check-packageid" ] + let sandboxes = [ "test/data", "test/data/check-packageid" + , "test/data/duplicate-pkgver/" ] genSandboxCfg dir = withDirectory dir $ \cwd -> do system ("sed 's|@CWD@|" ++ cwd ++ "|g' cabal.sandbox.config.in > cabal.sandbox.config") pkgDirs = [ "test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d" - , "test/data/check-packageid/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d"] + , "test/data/check-packageid/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d" + , "test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d"] genGhcPkgCache dir = system $ "ghc-pkg recache --force -f" ++ dir genSandboxCfg `mapM_` sandboxes genGhcPkgCache `mapM_` pkgDirs diff --git a/test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-1.0-7c59d13f32294d1ef6dc6233c24df961.conf b/test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-1.0-7c59d13f32294d1ef6dc6233c24df961.conf new file mode 100644 index 0000000..826e7e8 --- /dev/null +++ b/test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-1.0-7c59d13f32294d1ef6dc6233c24df961.conf @@ -0,0 +1,4 @@ +name: template-haskell +version: 1.0 +id: template-haskell-1.0-7c59d13f32294d1ef6dc6233c24df961 +exposed: True diff --git a/test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-14e543bdae2da4d2aeff5386892c9112.conf b/test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-14e543bdae2da4d2aeff5386892c9112.conf new file mode 100644 index 0000000..9b9bbf2 --- /dev/null +++ b/test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-14e543bdae2da4d2aeff5386892c9112.conf @@ -0,0 +1,4 @@ +name: template-haskell +version: 2.8.0.0 +id: template-haskell-2.8.0.0-14e543bdae2da4d2aeff5386892c9112 +exposed: True diff --git a/test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf b/test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf new file mode 100644 index 0000000..e8d6158 --- /dev/null +++ b/test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf @@ -0,0 +1,4 @@ +name: template-haskell +version: 2.8.0.0 +id: template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c +exposed: True diff --git a/test/data/duplicate-pkgver/cabal.sandbox.config.in b/test/data/duplicate-pkgver/cabal.sandbox.config.in new file mode 100644 index 0000000..2eae397 --- /dev/null +++ b/test/data/duplicate-pkgver/cabal.sandbox.config.in @@ -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: @CWD@/test/data/duplicate-pkgver/.cabal-sandbox/packages +logs-dir: @CWD@/test/data/duplicate-pkgver/.cabal-sandbox/logs +world-file: @CWD@/test/data/duplicate-pkgver/.cabal-sandbox/world +user-install: False +package-db: @CWD@/test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d +build-summary: @CWD@/test/data/duplicate-pkgver/.cabal-sandbox/logs/build.log + +install-dirs + prefix: @CWD@/test/data/duplicate-pkgver/.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